On Tue, 17 Jun 2003 07:25:00 -0400, Vincent Bouret wrote:

>I want "A dog jumped over a ladder" to become "<xyz>A</xyz> dog jumped over
><xyz>a</xyz> ladder".

How about this...

$str = "A dog jumped over a ladder";

$str = preg_replace( "/(^| )(a)( |$)/i", "$1<xyz>$2</xyz>$3", str );


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

Reply via email to