note 96377 deleted from function.parse-url by danbrown

From: Date: Wed, 24 Feb 2010 01:42:29 +0000
Subject: note 96377 deleted from function.parse-url by danbrown
References: 1  Groups: php.notes 
Request: Send a blank email to php-notes+get-166306@lists.php.net to get a copy of this message
Note Submitter: matt at ge3k dot co dot uk ---- @ nirazuelos at gmail dot com Loved your function, but to avoid "Use of undefined constant" and "Undefined index" errors in your php error logs, I changed it to: function getHost2($address) { $parse_url = parse_url(trim($address)); return trim(@$parse_url['host'] ? $parse_url['host'] : array_shift(explode('/', $parse_url['path'], 2))); } Otherwise, great function that help me out. Cheers!

« previous php.notes (#166306) next »