Forum Moderators: coopster

Message Too Old, No Replies

gettings all Links in a Variable's Value

         

Anyango

5:21 am on Jul 24, 2006 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Yo Guys

lets say i have a variable named $content which has value=whole html of my home page.

now lets say there are 20 links in that html, is there a way to get all of them in an array like

$links[0]['url']="http://www.url.com";
$links[0]['text']="Click here";

$links[1]['url']="http://www.testing.com";
$links[1]['text']="Second Link";

and then is there a way to change those urls in that $content variable? i mean if i provide 20 new urls for replacing those old ones, can that be done? am not good at all at Regex i think regex should do it.

Regards

siMKin

6:09 am on Jul 24, 2006 (gmt 0)

10+ Year Member



There are a lot of examples in the user-comments:

[php.net...]
[php.net...]