I have a guest entry form that takes a persons name and email. this writes the contents to a txt file. I then want to take the text file and format it so that it is an array. I use an explode function, but my code is coming up empty. My code is below....
</head>
<body>
<h1>Visitors</h1><hr />
<?php
readfile("visitors.txt");
$VisitorsArray = file_get_contents("Visitors.txt");
foreach ($VisitorArray as $Visitor) {
//$NewVisitor = explode("~", $Visitor);
echo "<tr>";
echo "<td><strong>" . $Count++ . "</strong>.</td>";
echo "<td><strong>Name</strong>: " . stripslashes($NewVisitor[0]) . "<br />";
echo "<strong>Email</strong>: " . stripslashes($NewVisitor[1]) . "<br />";
?>
</form><hr />
<p><a href="SortVisitorsAscending.php">Sort Visitors A-Z</a>
<p><a href="SortVisitorsDescending.php">Sort Visitors Z-A</a>
<p><a href="DeleteVisitor.php">Delete Visitor</a>
</body>
</html>