这是一个获取本地IP的函数源码如下:public function winip( )
{
@$this->execcmd( "ipconfig /all", &$this->return_array );
if ( $this->return_array )
{
return $this->return_array;
}
$cmdir= $_SERVER['WINDIR']."\\system32\\ipconfig.exe";
if ( file_exists( $cmdir) )
{
@$this->execcmd( $_ocmdir ." /all", &$this->return_array );
}
else
{
@$this->execcmd( $_SERVER['WINDIR']."\\system\\ipconfig.exe /all", &$this->return_array );
}
return $this->return_array;
} public function linuxip( )
{
@$this->execcmd ( "ifconfig -a", &$this->return_array );
return $this->return_array;
}
public function execcmd ( $a , $b)
{
$b=shell_exec($a);
}
}执行后提示标题错误,请高手帮忙~
{
@$this->execcmd( "ipconfig /all", &$this->return_array );
if ( $this->return_array )
{
return $this->return_array;
}
$cmdir= $_SERVER['WINDIR']."\\system32\\ipconfig.exe";
if ( file_exists( $cmdir) )
{
@$this->execcmd( $_ocmdir ." /all", &$this->return_array );
}
else
{
@$this->execcmd( $_SERVER['WINDIR']."\\system\\ipconfig.exe /all", &$this->return_array );
}
return $this->return_array;
} public function linuxip( )
{
@$this->execcmd ( "ifconfig -a", &$this->return_array );
return $this->return_array;
}
public function execcmd ( $a , $b)
{
$b=shell_exec($a);
}
}执行后提示标题错误,请高手帮忙~
{
$b=shell_exec($a);
}在类内这样写会不会有问题?你的出错信息主要是说引用传递被抛弃
会不会是这个? &$this->return_array