$url = parse_url($src); if (!empty($url['query'])) { $src = $url['scheme'].'://'.$url['host'].$url['path']; }