note 71778 added to function.parse-url

From: Date: Fri, 15 Dec 2006 12:26:46 +0000
Subject: note 71778 added to function.parse-url
Groups: php.notes 
Request: Send a blank email to php-notes+get-120629@lists.php.net to get a copy of this message
didn't test my version but it should be better than your library of TLD's... personally i only pass on $HTTP_HOST to the explode-line (with '.' instead of '/') and don't need the rest - y parse the entire uri anyways? well, have fun with this: function normalize_domain($uri) { $uri = str_replace('www.','',str_replace('http://','',$uri)); if(!strstr($uri,'/')) return $uri; $DOMAIN_ARRAY = explode('/',$uri); return $DOMAIN_ARRAY[0]; } ---- Server IP: 66.163.161.117 Probable Submitter: 85.178.231.125 ---- Manual Page -- http://www.php.net/manual/en/function.parse-url.php Edit -- https://master.php.net/note/edit/71778 Del: integrated -- https://master.php.net/note/delete/71778/integrated Del: useless -- https://master.php.net/note/delete/71778/useless Del: bad code -- https://master.php.net/note/delete/71778/bad+code Del: spam -- https://master.php.net/note/delete/71778/spam Del: non-english -- https://master.php.net/note/delete/71778/non-english Del: in docs -- https://master.php.net/note/delete/71778/in+docs Del: other reasons-- https://master.php.net/note/delete/71778 Reject -- https://master.php.net/note/reject/71778 Search -- https://master.php.net/manage/user-notes.php

« previous php.notes (#120629) next »