Display contents of multiple text files

Analyst

New Member
I have a number of text files held in directory \[code\]/results/...\[/code\]All the text files are named with unixtime stamps, inside each of the following files there is: \[code\]#text?test?test1?test2?test3?test4?1262384177\[/code\]Each piece of text is seperated by '?'.I'd then like to feed the contents of the text file into an array and output it, in for example a table, but for each of the files (Perhaps loop-like?)If have this but it only works for one file and fixed file name:\[code\]$filename = "results/unixtime.txt";$handle = fopen($filename, "r");$contents = fread($handle, filesize($filename));fclose($handle);$array01 = explode("?",$contents);$count = count($array01);echo "<table width = 500 border=1 cellpadding=4>";$i=0;for ($i=0;$i<$count;$i++) {echo "<tr><td>";echo $array01[$i];echo "</td></tr>";}echo "</table>";\[/code\]
 
Back
Top