note 118563 added to function.preg-replace-callback-array
| From: | jfcherng at NOSPAM dot gmail dot com | Date: | Tue, 29 Dec 2015 06:25:31 +0000 |
| Subject: | note 118563 added to function.preg-replace-callback-array | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-204558@lists.php.net to get a copy of this message | ||
Here's a possible alternative in older PHP.
<?php
// if (!function_exists('preg_replace_callback_array')) {
function preg_replace_callback_array (array $patterns_and_callbacks, $subject, $limit=-1,
&$count=NULL) {
$count = 0;
foreach ($patterns_and_callbacks as $pattern => &$callback) {
$subject = preg_replace_callback($pattern, $callback, $subject, $limit, $partial_count);
$count += $partial_count;
}
return preg_last_error() == PREG_NO_ERROR ? $subject : NULL;
}
// }
?>
----
Server IP: 72.52.91.14
Probable Submitter: 140.114.14.51
----
Manual Page -- http://php.net/manual/en/function.preg-replace-callback-array.php
Edit -- https://master.php.net/note/edit/118563
Del: integrated -- https://master.php.net/note/delete/118563/integrated
Del: useless -- https://master.php.net/note/delete/118563/useless
Del: bad code -- https://master.php.net/note/delete/118563/bad+code
Del: spam -- https://master.php.net/note/delete/118563/spam
Del: non-english -- https://master.php.net/note/delete/118563/non-english
Del: in docs -- https://master.php.net/note/delete/118563/in+docs
Del: other reasons-- https://master.php.net/note/delete/118563
Reject -- https://master.php.net/note/reject/118563
Search -- https://master.php.net/manage/user-notes.php