/ Published in: PHP
You can get hostname from script environment - getenv("HTTP_HOST") (?!'.$host.') matches URLs always except local links
Expand |
Embed | Plain Text
return preg_replace('/href=["|\']?(http:\/\/(?!'.$host.')([^"\']*))["|\']?/ui', "href=\"/go.php?url=$1\" title=\"$1\" target=\"_blank\"", $text);
You need to login to post a comment.
