<?php
function getServerAddress() {
if($_SERVER['SERVER_ADDR']) {
return $_SERVER['SERVER_ADDR'];
}
$ifconfig = shell_exec('/sbin/ifconfig eth0');
preg_match('/addr:([\d\.]+)/',$ifconfig,$match);
return $match[1];
}
?>
您可能感兴趣的文章: