Apr 262010
Faster string length testing in PHP
Answer:
If you want to ensure a string variable has a particular length, you might use strlen
if ( strlen($str) > 10 ) {
// ...
}
A faster approach is to use isset
if ( isset($str[10]) ) {
// ...
}