古いログ ファイルからすべての行を削除し、一番下にある 50 行を新鮮に保ちたいと考えています。
どうすればこのようなことができますか、可能であればこれらの線の向きを変更できますか?
normal input
111111
2222222
3333333
44444444
5555555
output like
555555
4444444
3333333
22222
111111
50 行または 100 行のみを先頭に最新のログを表示します。
これにどうやって参加するの?
// set source file name and path
$source = "toi200686.txt";
// read raw text as array
$raw = file($source) or die("Cannot read file");
// join remaining data into string
$data = join('', $raw);
// replace special characters with HTML entities
// replace line breaks with <br />
$html = nl2br(htmlspecialchars($data));
HTMLファイルとして出力しました。では、これでコードはどのように実行されるのでしょうか?