note 61206 added to function.parse-url

From: Date: Sat, 28 Jan 2006 03:18:10 +0000
Subject: note 61206 added to function.parse-url
Groups: php.notes 
Request: Send a blank email to php-notes+get-102598@lists.php.net to get a copy of this message
Here is an example that shows the benefits of working with full URLs, including the scheme. If URL's path includes a colon (':' character) in it, scheme MUST be set, otherwise parse_url reports the section after the colon as the value of the port. Example : <?php $url="http://any.domain/?a=0:1"; $t=parse_url($url); var_export($t); ?> <br /> <?php $url="any.domain/?a=0:1"; $t=parse_url($url); var_export($t); ?> will give: array ( 'scheme' => 'http', 'host' => 'any.domain', 'path' => '/', 'query' => 'a=0:1', ) array ( 'host' => 'any.domain', 'port' => 1, 'path' => '/', 'query' => 'a=0:1', ) Cheers, http://geocities.com/artmine77/ ---- Server IP: 192.117.122.43 Probable Submitter: 212.235.28.172 ---- Manual Page -- http://www.php.net/manual/en/function.parse-url.php Edit -- http://master.php.net/manage/user-notes.php?action=edit+61206 Delete: added to the manual -- http://master.php.net/manage/user-notes.php?action=delete+61206&report=yes&reason=added+to+the+manual Delete: bad code -- http://master.php.net/manage/user-notes.php?action=delete+61206&report=yes&reason=bad+code Delete: spam -- http://master.php.net/manage/user-notes.php?action=delete+61206&report=yes&reason=spam Delete: useless -- http://master.php.net/manage/user-notes.php?action=delete+61206&report=yes&reason=useless Delete: non-english -- http://master.php.net/manage/user-notes.php?action=delete+61206&report=yes&reason=non-english Delete: already in docs -- http://master.php.net/manage/user-notes.php?action=delete+61206&report=yes&reason=already+in+docs Delete: other reasons -- http://master.php.net/manage/user-notes.php?action=delete+61206&report=yes Reject -- http://master.php.net/manage/user-notes.php?action=reject+61206&report=yes Search -- http://master.php.net/manage/user-notes.php

« previous php.notes (#102598) next »