I’m totaly new with this, i’m trying to echo the full line text of a chat log when a specific user write something and delete the message.
So if the line contains word-Empire and Delete message i would like to echo the full line.
also there’s to much specific characters so to convert it in JSON is painfull so the JSON isn’t an option here.
Thank you for your help!
<?php
$chat = file('20240805.log');
$user = "word-Empire";
$delmessage = "Delete message";
$file = "20240805.log";
$parts = new SplFileObject($file);
foreach ($parts as $line) {
echo "<pre>";
echo $line;
echo "</pre>";
}
?>
actually i have echo the full log but i don’t know how to just echo the line i want.
Liza is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.