ConFoo Montreal 2026: Call for Papers

Voting

: two plus one?
(Example: nine)

The Note You're Voting On

pjpawel
3 years ago
Unfortunately parse_url() DO NOT parse correctly urls without scheme or '//'. For example 'www.xyz.com' is consider as path not host:

Code:
<?php
var_dump
(parse_url('www.xyz.com'));
?>
Output:
array(1) {
["path"]=>
string(10) "www.xyz.com"
}

To get better output change url to:
'//www.xyz.com' or 'http://www.xyz.com'

<< Back to user notes page

To Top