Re: How to compare between two values?

From: Date: Fri, 16 Jan 2004 14:46:14 +0000
Subject: Re: How to compare between two values?
References: 1  Groups: php.general 
Request: Send a blank email to php-general+get-174806@lists.php.net to get a copy of this message
How to compare between two values
You may also use strcmp() to compare string values: if (strcmp($string1, $string2) == 0) {
     //do stuff
} I know that in ASP (*gasp*... he uses a MS technology!) the StrComp function has an increased performance difference over comparing the strings with an equals sign. I do not know whether this is also the case in PHP. But, nonetheless, it's just another way of doing things. Again, check the documentation. This one can be found at: http://www.php.net/manual/en/function.strcmp.php -Ben

« previous php.general (#174806) next »