the if condition is not executing and unable to print result, there is a blank page.
<?php
$url = $_SERVER['HTTP_HOST'];
$url_length = strlen($url);
if(substr($url, 0, 4 ) = 'www.') {
$url_length = $url_length - 4;
$url = substr($url, 4, $url_length);
}
echo $url_length.'<br />'.$url;
?>