Edit report at http://bugs.php.net/bug.php?id=52362&edit=1

 ID:          52362
 Comment by:  giorgio dot liscio at email dot it
 Reported by: emiobe at guehring dot de
 Summary:     give str_ireplace an option to refer the original string
 Status:      Open
 Type:        Feature/Change Request
 Package:     *General Issues
 PHP Version: 5.3.2

 New Comment:

use preg_replace with /i PCRE_CASELESS identifier



bogus


Previous Comments:
------------------------------------------------------------------------
[2010-07-16 14:13:21] emiobe at guehring dot de

Description:
------------
Currently I can search case-insensitive with str_ireplace. But when I
need the original string in the replacement I have to use
preg_replace//i. 



It would be nice to have the original text in a "magic variable" like $1
to avoid using the "expensive" preg-engine.

Test script:
---------------
currently:



print str_ireplace ("original", "<b>original</b>", "the ORIGINAL
text");



idea:



print str_ireplace ("original", "<b>$1</b>", "the ORIGINAL text");



Expected result:
----------------
the <b>original</b> text

Actual result:
--------------
the <b>ORIGINAL</b> text


------------------------------------------------------------------------



-- 
Edit this bug report at http://bugs.php.net/bug.php?id=52362&edit=1

Reply via email to