From:             
Operating system: 
PHP version:      5.3.2
Package:          *General Issues
Bug Type:         Feature/Change Request
Bug description:give str_ireplace an option to refer the original string

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 bug report at http://bugs.php.net/bug.php?id=52362&edit=1
-- 
Try a snapshot (PHP 5.2):            
http://bugs.php.net/fix.php?id=52362&r=trysnapshot52
Try a snapshot (PHP 5.3):            
http://bugs.php.net/fix.php?id=52362&r=trysnapshot53
Try a snapshot (trunk):              
http://bugs.php.net/fix.php?id=52362&r=trysnapshottrunk
Fixed in SVN:                        
http://bugs.php.net/fix.php?id=52362&r=fixed
Fixed in SVN and need be documented: 
http://bugs.php.net/fix.php?id=52362&r=needdocs
Fixed in release:                    
http://bugs.php.net/fix.php?id=52362&r=alreadyfixed
Need backtrace:                      
http://bugs.php.net/fix.php?id=52362&r=needtrace
Need Reproduce Script:               
http://bugs.php.net/fix.php?id=52362&r=needscript
Try newer version:                   
http://bugs.php.net/fix.php?id=52362&r=oldversion
Not developer issue:                 
http://bugs.php.net/fix.php?id=52362&r=support
Expected behavior:                   
http://bugs.php.net/fix.php?id=52362&r=notwrong
Not enough info:                     
http://bugs.php.net/fix.php?id=52362&r=notenoughinfo
Submitted twice:                     
http://bugs.php.net/fix.php?id=52362&r=submittedtwice
register_globals:                    
http://bugs.php.net/fix.php?id=52362&r=globals
PHP 4 support discontinued:          http://bugs.php.net/fix.php?id=52362&r=php4
Daylight Savings:                    http://bugs.php.net/fix.php?id=52362&r=dst
IIS Stability:                       
http://bugs.php.net/fix.php?id=52362&r=isapi
Install GNU Sed:                     
http://bugs.php.net/fix.php?id=52362&r=gnused
Floating point limitations:          
http://bugs.php.net/fix.php?id=52362&r=float
No Zend Extensions:                  
http://bugs.php.net/fix.php?id=52362&r=nozend
MySQL Configuration Error:           
http://bugs.php.net/fix.php?id=52362&r=mysqlcfg

Reply via email to