Accepts arrays for both patterns and replacements. From the docs:

<?php
$string = 'The quick brown fox jumped over the lazy dog.';

$patterns[0] = '/quick/';
$patterns[1] = '/brown/';
$patterns[2] = '/fox/';

$replacements[2] = 'bear';
$replacements[1] = 'black';
$replacements[0] = 'slow';

echo preg_replace($patterns, $replacements, $string);
?>

But anyway, problem solved... In a way...

On 8/16/06, Everett, Al (NIH/NIGMS) [C] <[EMAIL PROTECTED]> wrote:
>
> What does preg_replace do that REReplace() doesn't?
>
> -----Original Message-----
> From: Dmitrii Dimandt [mailto:[EMAIL PROTECTED]
> Sent: Wednesday, August 16, 2006 11:04 AM
> To: CF-Talk
> Subject: Re: Transform Unicode characters
>
> Because it transforms charactrs into garbage (sth. like %C4%B1 for ý). And
> I need human-readable format :)) Anyway. I guess I'll stick to my XML
> solution. I read mappings from a UTF-8 encoded XML file into arrays and then
> iterate over them and replace whatever characters I need. I miss PHP's
> preg_replace :)))
>
> 

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~|
Introducing the Fusion Authority Quarterly Update. 80 pages of hard-hitting,
up-to-date ColdFusion information by your peers, delivered to your door four 
times a year.
http://www.fusionauthority.com/quarterly

Archive: 
http://www.houseoffusion.com/groups/CF-Talk/message.cfm/messageid:250002
Subscription: http://www.houseoffusion.com/groups/CF-Talk/subscribe.cfm
Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4

Reply via email to