I would like to get the contents from a text file, and add certain peices of data to an array. I don't have a problem with reading the text file, but I can't work out how to seperate the peices of data in the text file. I thought maybe I could create a text file containing the following:
"DY","LS",User3"
And adding the following code to my PHP script:
Code: Select all
<?php
$filename = "users.txt";
$file = fopen($filename, "r");
$contents = fread($handle, filesize($filename));
fclose($file);
$users = array($contents);
echo($usersї0]);
?>Thanks, luke.