PROGRAM-7: Write A PHP Script To Read Data From TXT File and Display It in HTML Table (The File Contains Info in Format Name: Password: Email) - Code
PROGRAM-7: Write A PHP Script To Read Data From TXT File and Display It in HTML Table (The File Contains Info in Format Name: Password: Email) - Code
if (file_exists($filename)) {
$file = fopen($filename, "r");
if (count($parts) === 3) {
list($name, $password, $email) = $parts;
echo "<tr><td>" . trim($name) . "</td><td>" . trim($password) . "</td><td>" . trim($email) .
"</td></tr>";
}
17
}
echo "</table>";
fclose($file);
} else {
echo "The file $filename does not exist.";
}
?>
</body>
</html>
OUTPUT:
18