Re: How to compare 2 strings
| From: | Krzysztof Dziekiewicz | Date: | Tue, 04 Feb 2003 09:11:07 +0000 |
| Subject: | Re: How to compare 2 strings | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-134227@lists.php.net to get a copy of this message | ||
> 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;
> }
> }
If you have in one array "test" and in the other also "test"
(not "Test" nor "TEST" but "test") it must work.
By the way in
else echo "bad;
you have not got a quotation mark after "bad".
--
Krzysztof Dziekiewicz