I was wondering how to do this, this code will, as you know, get a certain line, now I need it to read up to a certain text, for example 55, and stop reading from there. As you can see, the log contains some spaces, and what function can I use to read up to code 55?
$row['MtID'] = unique identifier to indicate the row in which the result is.
So, for example, the result log will be
MM3,67624563 (unique identifier (MtID), 233262345599, http://mywebsite.com:8080/web/mm3_pixel.php?sspdata=ams1CIv44qa26LGkchACGKqShLrCtZieSyINNDEuMTkwLjg4LjIwOCgB&vurlid=993211,http://mywebsite.net/sspx?id=69171&sspdata=ams1CIv44qa26LGkchACGKqShLrCtZieSyINNDEuMTkwLjg4LjIwOCgB > Ok 55
$logfile = file("https://myweb.com/Pixel-Full.php?file=".$country."/".$today."-pixel-response.log"); foreach($logfile as $line_num = > $line) { if (strpos($line, $row['MtID']) !== false) { $getresult = strstr(htmlspecialchars($line), 'http://'); echo "<td>".$getresult."</td>"; } }
This system works as follows: the user request didn’t find anything, so in our log it will send a link to the error requested by the user and an error code so that we know what the problem is. Therefore, as soon as the system reads a line and continues to read another line, until it finds the code, it stops
source share