PHP语句获取当前访问域名echo与变量写法

echo:

<?
echo 'HTTP_HOST:'.$_SERVER['HTTP_HOST'];
?>

变量:

<?
$host = $_SERVER['HTTP_HOST'];
?>

调用方法:

<?=$host?>