$str = `ifconfig`;
// parse the string $str
echo $str;

解决方案 »

  1.   

    是这个
    exec ("ifconfig" ,$string);
    echo $string;
      

  2.   

    exec ("ifconfig" ,$string);
    print_f $string;//输出所有//如果需要输出某一行,可以用echo $string[5];
      

  3.   

    $string = `ifconfig`;
    echo $string;或者
    ob_start();
    system("ifconfig");
    $string = ob_get_contents();
    ob_clean();
    echo $string;