<?php $text = "1 out of 23"; echo preg_match('/\d+(?=\D*$)/', $text, $m) ? $m[0] : ''; echo "\n"; echo sscanf($text, '%*d out of %d')[0]; echo "\n--- \n"; $text = "1 out of 23 more"; echo preg_match('/\d+(?=\D*$)/', $text, $m) ? $m[0] : ''; echo "\n"; echo sscanf($text, '%*d out of %d')[0];
You have javascript disabled. You will not be able to edit any code.