[PHP] string replace using ereg

2001-07-16 Thread Jeroen Olthof
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

RE: [PHP] string replace using ereg

2001-07-16 Thread scott [gts]
'$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

RE: [PHP] string replace using ereg

2001-07-16 Thread scott [gts]
#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