首页 > 代码库 > PHP查看当前端口号

PHP查看当前端口号

<?php

echo "当前页面服务器IP地址为:";

echo $_SERVER["SERVER_ADDR"];

echo "<br />";

echo "当前客户端IP地址为:";

echo $_SERVER["REMOTE_ADDR"];

echo "<br />"; //www.2cto.com

echo "当前端口为:";

echo $_SERVER["SERVER_PORT"];

?>

PHP查看当前端口号