note 99096 added to function.substr
| From: | dot) | Date: | Tue, 27 Jul 2010 11:22:56 +0000 |
| Subject: | note 99096 added to function.substr | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-171169@lists.php.net to get a copy of this message | ||
@jeff dot swain at pcmmllc dot com
What the hell did you smoke?
$whereClause = substr($merge, strpos($merge,'WHERE', (strlen($merge) -
strpos($merge,'WHERE'))));
if strpos($merge,'WHERE') < strlen($merge)/2 than the first strpos will return FALSE
and be interpreted as 0, thus substr($merge,0) === $merge.
just do
$whereClause = substr($merge, strpos($merge,'WHERE'));
----
Server IP: 212.124.37.9
Probable Submitter: 89.15.213.148
----
Manual Page -- http://www.php.net/manual/en/function.substr.php
Edit -- https://master.php.net/note/edit/99096
Del: integrated -- https://master.php.net/note/delete/99096/integrated
Del: useless -- https://master.php.net/note/delete/99096/useless
Del: bad code -- https://master.php.net/note/delete/99096/bad+code
Del: spam -- https://master.php.net/note/delete/99096/spam
Del: non-english -- https://master.php.net/note/delete/99096/non-english
Del: in docs -- https://master.php.net/note/delete/99096/in+docs
Del: other reasons-- https://master.php.net/note/delete/99096
Reject -- https://master.php.net/note/reject/99096
Search -- https://master.php.net/manage/user-notes.php