13 lines
361 B
PHP
13 lines
361 B
PHP
<?php
|
|
|
|
if (!function_exists('get_linux_hostname')) {
|
|
/**
|
|
* hostname을 읽어옴... $_SERVER['HOSTNAME']을 대신해서 사용하기 위함.
|
|
*/
|
|
function get_linux_hostname()
|
|
{
|
|
preg_match('/HOSTNAME=(.*)/', file_get_contents('/etc/sysconfig/network'), $network);
|
|
list($key, $hostname) = explode('=', $network[0]);
|
|
return $hostname;
|
|
}
|
|
} |