>>>>> "VB" == "Brian V Bonini" <[EMAIL PROTECTED]> writes:
> Ah right, strings not words, I feel like a dummy now... ;-)
>> -----Original Message----- From: John Vanderbeck
>> [mailto:[EMAIL PROTECTED]] Sent: Thursday, February 15, 2001
>> 10:57 AM To: [EMAIL PROTECTED]; Robin Vickery;
>> [EMAIL PROTECTED] Subject: Re: [PHP] ereg_replace
>>
>> > $string = preg_replace(
>> > array( '/is/', '/string/' ),
>> > array( 'is not', 'bit of text' ),
>> > $string
>> > );
You could specify word boundaries on each side of your string
to get the behaviour you were expecting.
$string = preg_replace(
array( '/\bis\b/', '/\bstring\b/' ),
array( 'is not', 'bit of text' ),
$string
);
--
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]