ASPN ActiveState Programmer Network
ActiveState
/ Home / Perl / PHP / Python / Tcl / XSLT /
/ Safari / My ASPN /
Cookbooks | Documentation | Mailing Lists | Modules | News Feeds | Products | User Groups


Recent Messages
List Archives
About the List
List Leaders
Subscription Options

View Subscriptions
Help

View by Topic
ActiveState
.NET Framework
Open Source
Perl
PHP
Python
Tcl
Web Services
XML & XSLT

View by Category
Database
General
SOAP
System Administration
Tools
User Interfaces
Web Programming
XML Programming


MyASPN >> Mail Archive >> php-general
php-general
[PHP] Re: case-insensitive str_replace
by CC Zona other posts by this author
May 2 2002 10:01PM messages near this date
Re: [PHP] Re: case-insensitive str_replace | Re: [PHP] Re: case-insensitive str_replace
In article <20020502210824.78972.qmail@[...].com> ,
 dark_panda@[...].com (J Smith) wrote:

>  Reuben D Budiardja wrote:
>  
>  > I am in need of a case-insensitive str_replace.<snip>
>  > 
>  > The feature that I use in str_replace is to put the 'search' and 'replace'
>  > argument as an array, as described in the documentation for php >= 4.0.5
>  > Some people suggested some functions in the archive and documentation, but
>  > I cannot find anything that can receive arrays as the arguments.

>  preg_replace() can be used with arrays.

Yes, just use the "i" (for "case insensitive") modifier after the closing 
regex pattern delimiter:

$patterns=array("/foo/i","/bar/i");

-- 
CC

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php
Thread:
Reuben D Budiardja
J Smith
Reuben D Budiardja
CC Zona
Philip Olson
CC Zona
Mike Eheler

Privacy Policy | Email Opt-out | Feedback | Syndication
© ActiveState Software Inc. All rights reserved