note 99439 deleted from function.substr by danbrown
| From: | danbrown@php.net | Date: | Wed, 18 Aug 2010 15:53:48 +0000 |
| Subject: | note 99439 deleted from function.substr by danbrown | ||
| References: | 1 | Groups: | php.notes |
| Request: | Send a blank email to php-notes+get-171814@lists.php.net to get a copy of this message | ||
Note Submitter: john at everyonealive dot com
----
I'm not sure if this is just an issue with PHP4, but apparently the substr method will add a
carriage control character to the begging of the returned string. This can leave you pulling your
hair out over a simple string comparison if you're not aware of it.
$result = substr($sql, -13);
result = trim($result);
if ( $result == "RESOURCES" )
echo "a match!"