note 18479 deleted from language.operators.comparison by sniper
| From: | sniper@php.net | Date: | Mon, 13 Oct 2003 00:16:23 +0000 |
| Subject: | note 18479 deleted from language.operators.comparison by sniper | ||
| References: | 1 | Groups: | php.notes |
| Request: | Send a blank email to php-notes+get-58430@lists.php.net to get a copy of this message | ||
Note Submitter: c.hester@ukonline.co.uk
----
If your strings are identical but include a space at the end, a comparison fails to return true!
I have a script that needs to split a string down into single words, remove one of them, then
rebuild it. Call me lazy, but the way I did it always has a space at the end because the number of
words to split down varies. I could not get the code to work until I added a line to strip out the
trailing space.
Of course there are many ways to solve this problem, but why does the comparison fall down when the
strings are exactly the same but with a space at the end?