RE: [PHP] Idea for new operator
| From: | Pablo Gosse | Date: | Mon, 27 Oct 2003 03:02:28 +0000 |
| Subject: | RE: [PHP] Idea for new operator | ||
| Groups: | php.general | ||
| Request: | Send a blank email to php-general+get-167670@lists.php.net to get a copy of this message | ||
On Sunday, October 26, 2003 5:40 PM Al wrote:
> Is it just me, or would everybody else like to see a case-insensitive
> string comparison operator introduced into PHP?
You could use the strcasecmp() function as well:
http://ca3.php.net/manual/en/function.strcasecmp.php
<?php
$var1 = "Hello";
$var2 = "hello";
if (strcasecmp($var1, $var2) == 0) {
echo '$var1 is equal to $var2 in a case-insensitive string
comparison';
}
?>
Cheers,
Pablo