Hi All
I need help with my small code here:
Code:
<table align="center" border="0"><tr>
<?php
$cols_num = 5;
$folder=opendir(".");
$cols = 0;
while ($file = readdir($folder)) {
$ext = strtolower(substr($file,strrpos($file, ".")+1));
$pics = array("jpg","jpeg","png","gif");
if (in_array($ext,$pics)){
print "<td align='center' width='50' height='50'><img src='$file'></td>";
++$cols;
if ($cols == $cols_num) {
print "</tr><tr>";
$cols = 0;
}
}
}
closedir($folder);
?>
</tr></table>
I want - for example - every 10 icons or 20 in one page ( pagination )
also if I've any error in my code please correct me
thanks in advance
Last edited by Goal; 10-24-2010 at 09:36 AM..
|