Basically i have a script that outputs a list of information about a file, Here is a sample
File Size:15423 bytes
File Name:Test.txt
File Location:C:\home\Test.txt
File MD5 Hash:1caf4a063526d84cd5b1ae6383a426d6
File SHA1 Hash:e79bfba095a8531adcb855d7c286f5c3ca93a535
My problem is that i want to split the data into two columns, For example "File Size:" Never changes so i want that as one column and then "15423 bytes" in a second column but that value changes. Here is my current code to how it displays that data.
$trID_Log_File = "testFile.txt";
if(file_exists($trID_Log_File) && filesize($trID_Log_File) > 0) {
$h = fopen($trID_Log_File, "r");
$contents = fread($h, filesize($trID_Log_File));
fclose($h);
if(!stristr($contents, "TrID is best suited to analyze binary files!")) {
$content .= "<table cellspacing=\"0\" cellpadding=\"0\">\n";
$content .= "<tbody>\n";
$i = 0;
$lines = explode("\n", $contents);
foreach($lines as $line) {
if(strlen($line) > 5) {
$content .= "<tr>\n";
$content .= "<td class=\"".($i % 2 == 0 ? "odd" : "even")."\" style=\"text-align: left; padding: 2px\">".$line."</td>\n";
$content .= "</tr>\n";
$i++;
}
}
$content .= "</tbody>\n";
$content .= "</table>\n";
$content .= "<div class=\"border\"></div>\n";
}
}
Any help here?