php - Preg_match symbols using? -
in code
<div class="count">#3</div><div class="count">#4</div><div class="count">#5</div>
the numbers different every time how can see them , sum tested with
$b = explode('</div><div class="count">', $cnt); for($i=1;$i<sizeof($b);$i++) preg_match("/([0-9]+)/", $b[$i], $m);
but see numbers not sum :(
you don't need regular expressions even:
echo array_sum(str_split(filter_var($string, filter_sanitize_number_int)));
outputs
12
Comments
Post a Comment