Jump to content

url replace


drifter

Recommended Posts

I have a page that I got from file_get_contents.

I want to replace all href="/some/page/here.php?with=a&query=string" with something like

href="http://mydomain.php?page=http://originaldomain.com/some/page/here.php?with=a&query=string"

obviously this all needs to be urlencoded(http://originaldomain.com/some/page/here.php?with=a&query=string)

is there an easy way to do this? Do I need to do a preg_match then look through all matches and do a str_replace on each one?

thanks
Scott
Link to comment
https://forums.phpfreaks.com/topic/30286-url-replace/
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.