note 26028 deleted from function.strstr by nlopess
| From: | nlopess@php.net | Date: | Fri, 05 Jan 2007 20:34:53 +0000 |
| Subject: | note 26028 deleted from function.strstr by nlopess | ||
| References: | 1 | Groups: | php.notes |
| Request: | Send a blank email to php-notes+get-121341@lists.php.net to get a copy of this message | ||
Note Submitter: duke as mastre dot com
----
strstr(), strchr(), strrchr() _and_ stristr() are _all_ broken as of 4.2.3:
$haystack = 'John Doe <john@doe.com>';
$needle_broken = '<';
$needle_ok = '@';
echo('haystack: ' . htmlspecialchars($haystack) . '<br />');
echo('strstr using needle_broken: ' . strstr($haystack, $needle_broken) . '<br
/>');
echo('strstr using needle_ok: ' . strstr($haystack, $needle_ok) . '<br
/>');
output:
broken:
ok: @doe.com>
only function that works properly with this caracter (also '>' and possibly others) is
strpos()