note 23496 deleted from language.operators.comparison by sniper

From: Date: Mon, 13 Oct 2003 00:16:56 +0000
Subject: note 23496 deleted from language.operators.comparison by sniper
References: 1  Groups: php.notes 
Request: Send a blank email to php-notes+get-58434@lists.php.net to get a copy of this message
Note Submitter: arthur@do.not.spam.batman.is ---- "If your strings are identical but include a space at the end, a comparison fails to return true!" I have to agree with aaron here. Space isn't just "nothing", though it may seem so on paper. A space has an ascii value just like any other character and takes up exactly the same amount of memory and should therefore never be considered "nothing" og "null". Or our more natural language: (' ' == chr(32)) && (' ' > null) && strlen(' ') == 1 It is a good habit to trim() all user input like Aaron mentioned, although I myself am way too lazy for that. Arthur

« previous php.notes (#58434) next »