note 76644 added to function.substr-count
| From: | danjr33 at gmail dot com | Date: | Tue, 24 Jul 2007 13:37:07 +0000 |
| Subject: | note 76644 added to function.substr-count | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-128883@lists.php.net to get a copy of this message | ||
I ran into trouble using this function when I moved a script from a server with PHP5 to a server
with only PHP4.
As the last two parameters were added with 5.1.0, I wrote a substitute function:
<?php
function substr_count5($str,$search,$offset,$len) {
return substr_count(substr($str,$offset,$len),$search);
}
?>
Use it exactly as substr_count() is used in PHP5. (This will work in PHP5 as well.)
----
Server IP: 69.147.83.197
Probable Submitter: 24.5.34.80
----
Manual Page -- http://www.php.net/manual/en/function.substr-count.php
Edit -- https://master.php.net/note/edit/76644
Del: integrated -- https://master.php.net/note/delete/76644/integrated
Del: useless -- https://master.php.net/note/delete/76644/useless
Del: bad code -- https://master.php.net/note/delete/76644/bad+code
Del: spam -- https://master.php.net/note/delete/76644/spam
Del: non-english -- https://master.php.net/note/delete/76644/non-english
Del: in docs -- https://master.php.net/note/delete/76644/in+docs
Del: other reasons-- https://master.php.net/note/delete/76644
Reject -- https://master.php.net/note/reject/76644
Search -- https://master.php.net/manage/user-notes.php