I have 568 rows in my csv file and my for loop looks like this
$csv = array();
$file = fopen('names.csv', 'r');
while (($result = fgetcsv($file)) !== false)
{
$csv[] = $result;
}
fclose($file);
for ($row = 0; $row < 568; $row++)
{
echo "Serial no:<br/>";
echo "Name:".$csv[$row][1]."";
}
I want the output like this…
Serial no: 1
Name: Blah blah 1
Serial no: 2
Name: Blah blah 2
............
............
Serial no: 10
Name: Blah blah 10
For each 10 rows i want serial 1 to 10.. Once it finished 10 rows i want a horizontal line..
I mean i want to print
echo "<hr>";
For every 10 rows..
Can anyone help me?
Thanks
This should work :
Explanation :
But the real good way to do this would be :