Code: Select all
Story Name||Story Author||Story Publisher||Story Date||Story PriorityCode: Select all
<?php
$nameArray = array("title","author","paper","date","priority");
$filePointer = fopen("stories.txt","r");
$fileArray = array();
$titleArray = array();
$authorArray = array();
$paperArray = array();
$dateArray = array();
$priorityArray = array();
$arrayCounter = 0;
$nameCounter = 0;
while ($nameCounter<=4)
{
$line = fgets($filePointer,4096);
while ($arrayCounter<=4)
{
$setArray = $nameArrayї$arrayCounter]."Array";
${$setArray}ї$nameCounter] = // ?? //
$arrayCounter++;
}
$arrayCounter = 0;
$nameCounter++;
}
fclose($filePointer);
?>But, I began to think....would it just be easier and run faster if the script never stored the file variables as actual variable, it just used one temporary variable, read from the file, the printed the HTML, then did it all over again?
Can anyone tell me which was would be faster and more effective, and possibly section a starting point on how to seperate the file from the delimiters? Thanks!