I have number '1 out of 023' i want 023 from string and add plus 1 number in 023 so new number will be 024 and string will be '1 out of 024'
i used following code (stackoverflow)
$text = '1 out of 23';
preg_match('/\d+ out of (\d+)/', $text, $matches);
$lastnum1 = $matches[1];
$text = "1 out of 23";
$words = explode(" ",$text);
$lastnum = (int)array_pop($words);