$string = 'https://www.facebook.com/photo?fbid=779422355402667&set=pob.100000045437749[/FONT][/COLOR]'; $e = explode("&"); echo $e[0];