RE: [PHP] How to compare 2 strings
| From: | Matt Schroebel | Date: | Mon, 03 Feb 2003 14:40:32 +0000 |
| Subject: | RE: [PHP] How to compare 2 strings | ||
| Groups: | php.general | ||
| Request: | Send a blank email to php-general+get-134118@lists.php.net to get a copy of this message | ||
> -----Original Message-----
> From: Roman Duriancik [mailto:rduriancik@indprop.gov.sk]
> Sent: Monday, February 03, 2003 9:31 AM
> Subject: [PHP] How to compare 2 strings
>
> How to compare 2 strings in PHP
> I hawe 2 array where I have only string values some values in
> both arrays
> are same but if command don't send me a good result.
> e.g
>
> foreach ($array1 as $a1) {
> foreach($array2 as $a2){
> if ($a1 == $a2) echo "good"; //never system send me a good result
> else echo "bad;
> }
> }
See Strcmp()