yeah regular expression is the best way to do it, i kne it seems like its tough bt its really easy. check out for a regular expression tutorial in the tutorial section. it can help u out really well.
for a begining try this stmt.
CODE
$myurl = 'http://www.yoursite.com/goto=';
$replacedmessage = preg_replace('|(http:\/\/(.*)+)|Ui',$myurl.'$1',$message);
what the above code will do is tht it will check for 'http://' and it will replace the entire string that starts with 'http://' to 'http://www.yoursite.com/goto=http://[rest of the link]' .
or u can use this
CODE
$replace = preg_replace('/(\<a.*href=[\"|\'])(.*)([\"|\']\>)/Ui','$1'.$myurl.'$2'.'$3',$text);
this will replace all the links inside the <a> tag.
hope it helps u out.
takecare.
This post has been edited by silverblaze: 8 Jun, 2008 - 12:41 PM