I'm trying to parse a url to get the host.
This is what I have tried.
$PHP_SELF = $_SERVER['PHP_SELF'];
$url = parse_url('$PHP_SELF');
$host = $url['host'];
echo $host;
The error I get is:
Notice: Undefined index: host in F:\Dev.Work\crc\includes\url.php on line 4
It has not worked. I have globals turned off, but I'm not sure if this has anything to do with it.