How can I get 23 instead of 1 for $lastnum1?
23
1
$lastnum1
$text = "1 out of 23"; $lastnum1 = $this->getEval(eregi_replace("[^* out of]", '', $text));
you could do:
$text = "1 out of 23"; if(preg_match_all('/d+/', $text, $numbers)) $lastnum = end($numbers[0]);
2.1m questions
2.1m answers
60 comments
57.0k users