note 99490 deleted from function.parse-url by cmb
| From: | cmb@php.net | Date: | Sun, 08 Sep 2019 10:33:36 +0000 |
| Subject: | note 99490 deleted from function.parse-url by cmb | ||
| References: | 1 | Groups: | php.notes |
| Request: | Send a blank email to php-notes+get-212150@lists.php.net to get a copy of this message | ||
Note Submitter: przemek at sobstel dot org
----
If you want to get host, function will return NULL if you pass only host.
Example:
<?php
parse_url($url, PHP_URL_HOST);
?>
$url => value returned
http://example.com => string 'example.com' (length=11)
http://www.example.com =>string 'www.example.com'
(length=15)
http://www.example.com:8080 => string
'www.example.com' (length=15)
example.com => null
www.example.com => null
example.com:8080 => string 'example.com' (length=11)
www.example.com:8080 => string 'www.example.com' (length=15)