Here is a quick post on how to find and replace relative links with absolute links using PHP Regular Expressions (regex).
$url = "http://myabsoluteurl.com/"; $ret = preg_replace('/((?:href|src) *= *[\'"](?!(http|ftp)))/i', "$1$url", $ret);
Here is a quick post on how to find and replace relative links with absolute links using PHP Regular Expressions (regex).
$url = "http://myabsoluteurl.com/"; $ret = preg_replace('/((?:href|src) *= *[\'"](?!(http|ftp)))/i', "$1$url", $ret);
Leave a Reply