Date: 06/18/06 (PHP Community) Keywords: no keywords Ok, I'm writing a script that reads out values from a text file and prints 5 per row. What I've currently got: $patches = array(); while(!feof($fp)): $patch = fgetcsv($fp, 4096); for ($i = 0; $i < 1; $i++): $patches[] = $patch[0]; endfor; endwhile; // let's now loop for every 5 records $numpatch = count($patches); $numpatch = ceil($numpatch/5); for ($i = 0; $i < $numpatch; $i++): print " currently just loops the first set of 5 records returned based on the number of rows used. Is there a way for this to actually return the proper results with the right loopthrough (e.g. 2nd runthrough by for() returns the 2nd set of 5 results)? EDIT: Solved; for ($a = 0; $a < 5; $a++): $num = $i*5+$a; echo " fixed everything. Thanks olithered!
|