Forum Moderators: coopster
$URL_Got = $_SERVER['SCRIPT_NAME'] . '?' . $_SERVER['QUERY_STRING'];
$url_parts = parse_url($Product_URL);
$URL_Got = $url_parts['path'] . '?' . $url_parts['query'];
$URL_Got = str_replace('http://www.example.com', '', $Product_URL) // Match occurrences of 'example.com'
// preceded by 'http://' and zero or
// more occurrences of an alphanumeric
// string followed by a dot:
$pattern = '/http:\/\/([a-z0-9]+\.)*example.com/i';
// Replace any of those matches with an empty string:
$URL_Got = preg_replace($pattern, '', $Product_URL);