Re: Reading a file and changing <a href> tag values
| From: | Plutarck | Date: | Sat, 14 Apr 2001 06:33:23 +0000 |
| Subject: | Re: Reading a file and changing <a href> tag values | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-48515@lists.php.net to get a copy of this message | ||
All you need is a regular expression, provided by ereg function or preg
functions.
You'd have the regex look for <a href then capture everything up to </a>
Then just adjust the result as you want it to appear.
You'll need to either search around for code that already does this, or be
willing to learn regular expressions (which you should do anyway).
Otherwise it will seem impossible.
--
Plutarck
Should be working on something...
...but forgot what it was.
""Brett"" <opensrs@jnewman.com> wrote in message
news:012701c0c4a2$cbc7f840$LocalHost@Default...
> I have been able to find out how to read a file and replace certain
matches,
> but I want to be able to take a web page stored in a string and change the
> <a href> tags and add www.mysite.com?page= before the actual link value
so
> the new url would read www.mysite.com?page=original_url. Can I do this
and
> if so will someone give me an idea how? Thanks.
>
> Brett
>
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, e-mail: php-general-unsubscribe@lists.php.net
> For additional commands, e-mail: php-general-help@lists.php.net
> To contact the list administrators, e-mail: php-list-admin@lists.php.net
>