תודה,
יש לך אולי מושג איך אני הופך את הקוד הזה:
PHP קוד:
<?php
if ($handle = opendir('img/avatars')) {
while (false !== ($file = readdir($handle))) {
if ($file != "." && $file != "..") {
echo "<img src='img/avatars/$file'><br>";
}
}
closedir($handle);
}
?>
שיציג כל תמונה ותמונה בכל תא בנפרד ב3 על 3?
יענו אין לי בעיה עם הלולאה והטבלה,
יש לי בעיה עם ה3 על 3 =\
אשמח אם תעזור..
עריכה:
ניסיתי לעשות את זה:
PHP קוד:
<table>
<?php
if ($handle = opendir('img/avatars'))
{
while (false !== ($file = readdir($handle)))
{
for ($j=1; $j<=3; $j++)
{ echo "<tr>"; }
for ($j=1; $j<=3; $j++) {
if ($file != "." && $file != "..") {
echo "<td><img src='img/avatars/$file'></td>"; }
}
echo "</tr>";
}
closedir($handle);
}
?>
</table>
אבל זה הציג לי כל תמונה 3 פעמים...