hi,
I want to replace strings in string using a key / value array as the
replacemant contract
basicly,
I want to find a open en close tag, pick out the word in the middle and
replace it by the value of the key that match the picked out word.
example
<> <>
should result in
this is a test this i
'$ASSIGN[$1]', $text );
prints:
Hello there, this is a test.
My name is BOB
To do what you want, throw a loop statement around the preg_replace
to loop thru each line of a file... etc... :)
> -Original Message-
> From: Jeroen Olthof [mailto:[EMAIL PROTECTED]]
> Sent: Mo
#x27;=> 'BOB', );
$OPENTAG = "<<";
$CLOSETAG = ">>";
print preg_replace( "/$OPENTAG(.*?)$CLOSETAG/e", '$ASSIGN[$1]', $text );
> -Original Message-
> From: Jeroen Olthof [mailto:[EMAIL PROTECTED]]
> Sent: Monday, July 16, 2001
3 matches
Mail list logo