note 4643 deleted from stristr by ronabop
| From: | ronabop@php.net | Date: | Mon, 05 Mar 2001 01:38:03 +0000 |
| Subject: | note 4643 deleted from stristr by ronabop | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-11876@lists.php.net to get a copy of this message | ||
Be careful in code near a stristr call. It seems that php tries to reuse variables where possible
so that in a code snippit like:
$temp = $variable;
$output = stristr ($something, $variable);
The variable $temp is converted to lowercase as well as $variable. (Just two pointers to the same
location I guess). A workaround is to make the assignment line:
$temp = $variable."";
or even shorten the code to:
$output = stristr($something, $variable."");