Display images from folder in table using php,html? -




i want display images in table form. here code:

<?php $files = glob("images/*.*"); ($i = 0; $i < count($files); $i++) {     $image = $files[$i];     $supported_file = array(         'gif',         'jpg',         'jpeg',         'png'     );      $ext = strtolower(pathinfo($image, pathinfo_extension));     if (in_array($ext, $supported_file)) {         echo basename($image); echo '<img src="' . $image . '" alt="random image" ,width=100px, height=100px /><br>'; } else { continue; } } ?> 

enter image description here

something picture.

if want in table add table tag , it

<table> <tr>   <th>image name</th>   <th>image</th> </tr> <?php $files = glob("images/*.*"); ($i = 0; $i < count($files); $i++) {     $image = $files[$i];     $supported_file = array(         'gif',         'jpg',         'jpeg',         'png'     );      $ext = strtolower(pathinfo($image, pathinfo_extension));     if (in_array($ext, $supported_file)) {       echo "<tr><td>";       echo basename($image);       echo "</td><td>";       echo '<img src="' . $image . '" alt="random image" ,width=100px, height=100px /><br>';       echo "</td></tr>"; } else { continue; } } ?> </table> 




wiki

Comments

Popular posts from this blog

Asterisk AGI Python Script to Dialplan does not work -

python - Read npy file directly from S3 StreamingBody -

kotlin - Out-projected type in generic interface prohibits the use of metod with generic parameter -