Ver original$variable = "http://www.youtube.com/watch?v=3FjSti5P7CU"; $url = explode("?v=", $variable); echo $url[1];