note 112072 added to function.substr-count
| From: | DouglasDennis | Date: | Mon, 29 Apr 2013 19:01:56 +0000 |
| Subject: | note 112072 added to function.substr-count | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-194659@lists.php.net to get a copy of this message | ||
It was previously noted that if you use "substr_count(implode(array))" with this array:
array (
0 => "mystringth",
1 => "atislong"
);
The following would result:
"If you are counting "that", the implode version will return 1, but the function
previously described will return 0."
You can fix this by using substr_count(implode(' ', array), 'that') which will
result in the following string: "mystringth atislong".
----
Server IP: 69.147.83.199
Probable Submitter: 216.228.172.224
----
Manual Page -- http://php.net/manual/en/function.substr-count.php
Edit -- https://master.php.net/note/edit/112072
Del: integrated -- https://master.php.net/note/delete/112072/integrated
Del: useless -- https://master.php.net/note/delete/112072/useless
Del: bad code -- https://master.php.net/note/delete/112072/bad+code
Del: spam -- https://master.php.net/note/delete/112072/spam
Del: non-english -- https://master.php.net/note/delete/112072/non-english
Del: in docs -- https://master.php.net/note/delete/112072/in+docs
Del: other reasons-- https://master.php.net/note/delete/112072
Reject -- https://master.php.net/note/reject/112072
Search -- https://master.php.net/manage/user-notes.php