Don't complicate your code if you don't need it. IF you need to find out the
length of the string, use PHP's built-in functions. They're faster and they
are easier to write, debug and for others to understand. If I missed your
point completely, forgive me.

And here's the code for you do figure out your problem.

if (strlen($string) > 20){
    print "error";
} else {
    print "OK";


PHP Database Mailing List (
To unsubscribe, visit:

Reply via email to