I am working with a log file that contains many lines. I want to use this log file in my dashboard. The file is in this format:
line1
line2
line3
line4
line5
line6
line7
line8
I want to read this file, and show its contents such as:
line1 line2 line3
line4 line5
line6 line7 line8
How can I do this in php?
Note: I can read the file and echo results in my dashboard. I just need the above function.
So far:
<php?>
$logs = File::get('logs.txt');
$lines=explode("\n", $logs);
echo $lines['0'];
but this shows me only the first line.