Re: - ereg_replace

From: Date: Fri, 14 Nov 2003 11:31:56 +0000
Subject: Re: - ereg_replace
References: 1 2  Groups: php.db 
Request: Send a blank email to php-db+get-31576@lists.php.net to get a copy of this message
Thank you for reply, but the <a> is not the only tag in my string. ... % ereg_replace("^<a href=\"([:alnum:])\">$", "<a href=\"\\1\" % target=\"_blank\">", $string) % % I echo the result but nothing changing. % What Im doing wrong? Is your string really the only thing on a line, or could it be anywhere in the input? The ^ (beginning) and $ (ending) anchors are probably messing you up. If your format *is* like this, you could do a quick preg_replace('/>$/',' target="_blank">',$string) (untested) and be done with it :-) % Thanx

« previous php.db (#31576) next »