//获取服务器系统 public function getOs() { $os_name = PHP_OS; if(strpos($os_name,"Linux")!==false){ $os_str = 1; //linux系统 }else if(strpos($os_name,"WIN")!==false){ $os_str = 2; //win系统 } return $os_str; }