Help with php code! Trying to get this code to print and just get "array" back?

marcey t

New member
Trying to get this array to print the data from the .txt file but all I get in output is "array"

$telephonelist = fopen("recordsdirectory.txt","a+");
if (filesize ("recordsdirectory.txt")<=0)
{
echo "empty";
exit (0);
}
$contents = fread($telephonelist,
filesize("recordsdirectory.txt"));
$newlist = explode(",",$contents);
for ($i=0;$i<count($newlist);$i++)
$newlist = array($newlist);
foreach ($newlist as $list)
{
echo "<p>{$list}</p>";
}
fclose($telephonelist);
 
Back
Top