>>>>> ""VB" == "Brian V Bonini" <[EMAIL PROTECTED]> writes:

 > I know you can replace A or B or C with D but can you replace A
 > with B and C with D exclusively with one call to ereg_replace or
 > does this need to be done seperately?

With ereg_replace it must be done seperately, but if you use
preg_replace you can pass it a list of replacements. like this:

<?php
$string = "this is my string.";

print $string . "<br>\n";

$string = preg_replace( 
                        array( '/my/', '/string/'    ), 
                        array( 'your', 'bit of text' ), 
                        $string 
                      );

print $string . "<br>\n";
?>

The output would be:

   this is my string.
   this is your bit of text.


-- 
Robin Vickery.................................................
BlueCarrots, 14th Floor, 20 Eastbourne Terrace, London, W2 6LE

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]

Reply via email to