$ip_cmd = "ifconfig eth0 | sed -n '/inet addr/p' | awk '{print $2}' | awk -F ':' '{print $2}'";
$ret = trim(exec($ip_cmd));
$ip_cmd = "ifconfig eth0 | sed -n '/inet addr/p' | awk '{print $2}' | awk -F ':' '{print $2}'";
$ret = trim(exec($ip_cmd));
转载于:https://www.cnblogs.com/xiaochongzi/p/6708000.html