note 32091 deleted from function.strcmp by vincent
| From: | vincent@php.net | Date: | Tue, 26 Aug 2003 09:49:25 +0000 |
| Subject: | note 32091 deleted from function.strcmp by vincent | ||
| References: | 1 | Groups: | php.notes |
| Request: | Send a blank email to php-notes+get-55088@lists.php.net to get a copy of this message | ||
Note Submitter: shovan@nyetspam.sanelane.com
----
If all you want to do is find out if two strings are the same or not, but do not care if one is
"greater" or "less" than the other, then the == operator is about 60% faster
than the strcmp() call. That is, for speed, do this:
if ($var1 == $var2)
Instead of this:
if (strcmp($var1, $var2) == 0)