PHP做内网文件共享的时候我们需要用到的局域网的ip地址。
$host_name = exec("hostname");
$host_ip = gethostbyname($host_name); //获取本机的局域网IP
if( empty( $host_ip ) )
{
echo "fail get host ip";
}
else
{
echo $host_ip;
}
PHP做内网文件共享的时候我们需要用到的局域网的ip地址。
$host_name = exec("hostname");
$host_ip = gethostbyname($host_name); //获取本机的局域网IP
if( empty( $host_ip ) )
{
echo "fail get host ip";
}
else
{
echo $host_ip;
}