if($id == 3){
$name="/tmp/youtube_upload.log";
$file = escapeshellarg($name);
$info = `tail -n 500 $file`;
}else if($id == 1){
chdir(LOGFILE);
$name=`ls -t |grep 'success_' | head -n1`;
$path=str_replace(PHP_EOL, '', $name);
$path=LOGFILE.$path;
$info="logファイル名:$path\n".file_get_contents($path);
}else if($id == 2){
chdir(LOGFILE);
$name=`ls -t |grep 'failure_' | head -n1`;
$path=str_replace(PHP_EOL, '', $name);
$path=LOGFILE.$path;
$info="logファイル名:$path\n".file_get_contents($path);
}
转载于:https://my.oschina.net/luqin/blog/775248