note 56638 deleted from function.parse-url by nlopess

From: Date: Tue, 11 Oct 2005 20:08:44 +0000
Subject: note 56638 deleted from function.parse-url by nlopess
References: 1  Groups: php.notes 
Request: Send a blank email to php-notes+get-96853@lists.php.net to get a copy of this message
Note Submitter: Spaceman Spiff <php at symlink dot dk> ---- I made this function: <?PHP function unparse_url($arr) { return($arr['scheme'].'://'. ($arr['user']?$arr['user']. ($arr['pass']?':'.$arr['pass']:'').'@':''). $arr['host'].($arr['port']?':'.$arr['port']:''). $arr['path'].($arr['query']?'?'.$arr['query']:''). ($arr['fragment']?'#'.$arr['fragment']:'')); } ?> It allows you to parse an URL, modify some fields, and then make it back into an URL.

« previous php.notes (#96853) next »