Jump to content

Display all...


GremlinP1R

Recommended Posts

[code]
<?php
    if ( $img_dir = @opendir('../images/') ) {
        while ( false !== ($img_file = readdir($img_dir)) ) {
            // add checks for other image file types here, if you like
if ( preg_match("/(\.jpg)$/", $img_file) ) {
              echo "<img src = '$img_file'>";
            }
        }
        closedir($img_dir);
    } else {
        echo "wrong path";
    }
?>
[/code]
Link to comment
https://forums.phpfreaks.com/topic/25561-display-all/#findComment-116639
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.