How do i change a url in a string example :
This is a link <a href="http://google.com.au">http://google.com.au</a>
To something like this
This a warning page link <a href="./warn.php?link=http://google.com.au">http://google.com.au</a>
EDIT:
What i'm trying to do is take a description entered by the end user, They might enter links in the description, i want to change all the links to make them GOTO a warning page, the warning page is ./warn.php?site=link
The string might look like this
This is a awesome description <a href="google.com.au">Google</a> and this another link <a href="http://google.com.au/images">Google images</a>
Ok here's what i tried:
$descc = mysql_real_escape_string($_POST['description']);
$descc = preg_replace('"\b(http://\S+)"', '<a href="./warn.php?site='.base64_encode(.'$1'.).'">$1</a>', $descc);