Re: - ereg_replace

From: Date: Fri, 14 Nov 2003 13:25:28 +0000
Subject: Re: - ereg_replace
References: 1  Groups: php.db 
Request: Send a blank email to php-db+get-31578@lists.php.net to get a copy of this message
ΝΙΚΟΣ ΓΑΤΣΗΣ wrote:
I'm trying to replace the string say <a href="http://www.mysite.gr"> with <a href=http://www.mysite.gr target="_blank"> with no luck I use the code: ereg_replace("^<a href=\"([:alnum:])\">$", "<a href=\"\\1\" target=\"_blank\">", $string)
Since it looks like you're changing all of the links, how about a simple str_replace() replacing '<a' with '<a target="_blank"' ?? -- ---John Holmes... Amazon Wishlist: www.amazon.com/o/registry/3BEXC84AB3A5E/ php|architect: The Magazine for PHP Professionals - www.phparch.com

« previous php.db (#31578) next »