$message = shell_exec('/home/centftp/example365up/example.sh'); echo nl2br($message); echo "<br/>本地同步完成。"; echo "<hr/>"; //同步本地更新文件列表到远程ftp服务器 $test = array('hostname' => '', 'username' => '', 'password' => ''); //取得本地更新列表 $filecount = 0; $filelist = array(); $templist = array(); $faildlist = array(); $example = new CI_FTP(); //处理列表 $regex = '#example.*#'; if (!preg_match_all($regex, $message, $templist)) { $example->add_log('访问过!' . "\n<br/>"); exit("没有文件更新,完成退出。"); } $i = 0; while (isset($templist[0][$i])) { $filelist[] = $templist[0][$i]; $i++; } //处理不需要上传的文件 for ($i = 0; $i < count($filelist); $i++) { #$temp = $filelist[$i]; /* //处理example目录 $exampleRegx = '#example/.*#'; if(preg_replace($Regx, '', $temp, 1, 1)) {