"Everybody is a genius. But if you judge a fish by its ability to climb a tree, it will live its whole life believing that it is stupid." – Albert Einstein

Posts tagged “php

paging using php with multiple rows and cols


If you want to do paging in php with multiple rows and columns use this code…

<?php

$i = 1;
$numcols = 6; // how many columns to display
$numcolsprinted = 0; // no of columns so far
$numitems = count($city_arr); // Number of Items
$numrows = ceil($numitems/$numcols); // Number of Rows

echo ‘
‘;
for ($row=1; $row <= $numrows; $row++)
{
$cell = 0;
echo ‘
‘.”n”;

for ($col=1; $col