Sorry. I mixed up my variabless in the following line (unless you want to use $char_count as the number count variable and $num_count as the character count variable

) ...
PHP Code:
if( is_numeric( $str{ $i } ) ) { $char_count++; } else { $num_count++; }
It should read...
PHP Code:
if( is_numeric( $str{ $i } ) ) { $num_count++; } else { $char_count++; }
Full code:
PHP Code:
$str = "00jkjdj0";
$char_count = 0;
$num_count = 0;
$u_bound = strlen( $str ) - 1;
for( $i = 0 ; $i <= $u_bound ; $i++ ) {
if( is_numeric( $str{ $i } ) ) { $num_count++; } else { $char_count++; }
}
echo $char_count;
echo $num_count;