3v4l.org

run code in 150+ php & hhvm versions
Bugs & Features
<?php $toto = "http://mercure-ws1.vente.francetelecom.fr:9010/ProjetMercure/servlet/accesauxapplis/.jsp?task=GererAccesAuxApplications&ctrl_choix_appli=NEPT"; @ $url = parse_url($toto); @ $port = $url['port']; if($port != "") @ $uri = $url['host'].":".$port; else @ $uri = $url['host']; echo var_dump($uri);
Output for 4.3.0 - 7.1.0
string(39) "mercure-ws1.vente.francetelecom.fr:9010"