php 使用shell_exec获取linux环境下的IP地址我想用shell_exec执行ip addr命令,但是发现返回的字符串为空?
本机的吗?ifconfig | grep "inet " | cut -d: -f2 | awk '{print $1}' | grep -v "^127."