Re: Regular Expressions
| From: | Adam Royle | Date: | Mon, 08 Apr 2002 04:00:44 +0000 |
| Subject: | Re: Regular Expressions | ||
| Groups: | php.db | ||
| Request: | Send a blank email to php-db+get-18306@lists.php.net to get a copy of this message | ||
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";
}
Adam