Hello list
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)
I echo the result but nothing changing.
What Im doing
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 ^
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
Hi again!
...and then ÍÉÊÏÓ ÃÁÔÓÇÓ said...
%
% Thank you for reply, but the a is not the only tag in my string.
You're quite welcome, and now we definitely know that ^ and $ are not
what you need.
HTH HAND
:-D
--
David T-G * There is too much animal courage in
(play)
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
, November 14, 2003 3:25 PM
Subject: Re: [PHP-DB] - ereg_replace
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
From: [EMAIL PROTECTED]
eregi_replace(a href=\(.+)\, a href=\\\1\ target=\_blank\
class=\down_txt\, $body);
How is that any different than just doing a str_replace() on a, though?
The str_replace() is going to be much faster than the eregi_replace()
function and href doesn't _have_ to be the
strip_tags() is used to remove HTML tags, eg for showing text on the browser
and then sending it by plain text email or storing in the db. As a matter
of interest, how is this done using ereg_replace. I thought this would work
^.*$, that is being with and any number of single characters ending
From: Dillon, John [EMAIL PROTECTED]
strip_tags() is used to remove HTML tags, eg for showing text on the
browser
and then sending it by plain text email or storing in the db. As a matter
of interest, how is this done using ereg_replace. I thought this would
work
^.*$, that is being with
Could somebody explain to me how the ereg_replace function works?
For as for as I understand it replaces strings by a different string (as
explained on the php site) but what I don't understand is how the
following line creates real links:
$Content =
I have a large string and want to replace some
substrings in it.
This substrings are delimited by a pair of tags (all
substrings), say: tag and /tag. i.e. There is the
tag tag at the beginning of the substring I want to
replace and a /tag tag at the end. There are several
of this substrings along
11 matches
Mail list logo