Jump to content

regular expressions - amending urls


chriso20

Recommended Posts

Hey,

 

Quick question -

 

How can i preg_replace (or whatever i need) these strings:

 

<a href="http://www.google.com">

<a href='www.anothersite.co.uk'>

<a href=whatever.net>

 

so they're replaced with:

 

<a href="mysite.com?url=http://www.google.com">

<a href="mysite.com?url=http://www.anothersite.co.uk">

<a href="mysite.com?url=http://www.whatever.net">

 

 

Thanks in advance!

Link to comment
https://forums.phpfreaks.com/topic/145484-regular-expressions-amending-urls/
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.