Re: - ereg_replace

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hi!

...and then ÍÉÊÏÓ ÃÁÔÓÇÓ said...
% 
...
%  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


HTH & HAND

:-D
-- 
David T-G                      * There is too much animal courage in 
(play) davidtg@xxxxxxxxxxxxxxx * society and not sufficient moral courage.
(work) davidtgwork@xxxxxxxxxxxxxxx  -- Mary Baker Eddy, "Science and Health"
http://justpickone.org/davidtg/      Shpx gur Pbzzhavpngvbaf Qrprapl Npg!

Attachment: pgp00076.pgp
Description: PGP signature


[Index of Archives]     [PHP Home]     [PHP Users]     [Postgresql Discussion]     [Kernel Newbies]     [Postgresql]     [Yosemite News]

  Powered by Linux