Currently, I am parseing a string for href tags and adding a "target=_blank"
to them to have them open up in a new window using this:
$body = preg_replace("<[aA] [hH][rR][eE][fF]=\"(.*?)\">", 'a href="$1"
target=_blank', $row->body);

This works, to the best of my knowledge, however I was curious if I could
have the target generated based on the url, so that each url would open in
its own window.  I decided to try to use the url's md5 to be its target, and
assumed that this would work:
$body = preg_replace("<[aA] [hH][rR][eE][fF]=\"(.*?)\">", 'a href="$1"
target=' . md5($1), $row->body);

however, I am getting this as an error:
Parse error: parse error, expecting `T_VARIABLE' or `'$'' in index.php on
line 201

Can anyone see what is going wrong here?

PHP General Mailing List (
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