From 4ee7faae085f3fc70ddf066992651fd177b3b47e Mon Sep 17 00:00:00 2001 From: Sara Golemon Date: Thu, 23 Jan 2003 01:04:50 +0000 Subject: [PATCH] Bug # 21816 Using indexed arrays with preg_replace git-svn-id: https://svn.php.net/repository/phpdoc/en/trunk@113078 c90b9560-bf6c-de11-be94-00142212c4b1 --- reference/pcre/functions/preg-replace.xml | 60 ++++++++++++++++++++++- 1 file changed, 59 insertions(+), 1 deletion(-) diff --git a/reference/pcre/functions/preg-replace.xml b/reference/pcre/functions/preg-replace.xml index 94e0191d59..3f005ac27a 100644 --- a/reference/pcre/functions/preg-replace.xml +++ b/reference/pcre/functions/preg-replace.xml @@ -1,5 +1,5 @@ - + @@ -78,6 +78,64 @@ April1,2003 Every parameter to preg_replace (except limit) can be an array. + + + + When using arrays with pattern and + replacement, the keys are processed + in the order they appear in the array. This is + not necessarily the same as the numerical + index order. If you use indexes to identify which + pattern should be replaced by which + replacement, you should perform a + ksort on each array prior to calling + preg_replace. + + + + Using indexed arrays with <function>preg_replace</function> + + +]]> + + + If subject is an array, then the search and replace is performed on every entry of