- substr: documentation ( source)
- ctype_digit: documentation ( source)
<?php
// keeping a loop going with an empty statement until conditional becames true
$input = "the number of letters in mississippi = 11";
$i=0;
$cp = $input;
while( !(ctype_digit($cp[$i++]) ) )
;
echo substr($input,--$i),"\n";