Desired output (with table border around them):
see desired_result.png
Actual output (with table border around them):
see actual_result.png
My code:
$myfile = "/tmp/site_survey";
if (file_exists($myfile)) {
$file_handle = fopen($myfile,rb);
fgets($file_handle); //skip the first line
echo "<table border = 2>";
while (!feof($file_handle)) {
$line_of_text = fgets($file_handle);
$tok = strtok($line_of_text," ");
echo "<tr>";
while ($tok) {
echo "<td>";
if (empty($tok)) {
echo " ";
} else {
echo "$tok";
$tok = strtok(" ");
}
echo "</td>";
}
echo "</tr>";
}
fclose($file_handle);
echo "</table>";
} else {
print "File doesn't exist!";
}
The echo   seems to be failed, does anyone know why? Any help is appreciated, thanks