PHP:how to determine the first occurrence of a number?

sandy360

New member
I tried counting all the 0's like this:
$b1 = substr_count($number, '0');

but if $number=00000203;
$b1 will return 6 when the desired
result is 5

What I really want to do here is to separate the
203 from the DB value of 00000203 during display
 
Back
Top