I got a regular expression from the code library.
(The file is outputlib.php by Ying Zhang)
For some odd reason, when there is a querystring in the URL, i get an extra semicolon at the end of that link. I'm not sure if that occurrs by default or not, but i definately don't want it there.
otherwise, if there isn't a querystring in the link, i get a forward slash '/' at the end of the string, which is ok.
$output = "http://domain.com/user/user.php?yes=blah&";
$output = preg_replace("((http://|ftp://)+([a-zA-Z0-9\-_\.]+[a-zA-Z0-9\-_]+\.[a-zA-Z]{2,3}(/[a-z\-/\._\?=&]+)?))", "<a href=\"\\1\\2\" target=\"_blank\">\\0</a>", $output);
This is the output of that string:
http://domain.com/user/user.php?yes=blah&;
i would like for it to output like this:
http://domain.com/user/user.php?yes=blah&
(semicolon ';' is gone.)
Any help would be greatly appreciated.
Thanks.
sijis