Display All Images With Image Name From A Folder Using PHP

You can display all image from a folder using simple php script. Suppose folder name “images” and put some image in this folder then you a editor and paste this code and run this script.
This is php code
 <?php
     $files = glob("images/*.*");
     for ($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)."<br />"; // show only image name if you want to show full path then use this code // echo $image."<br />";
             echo '<img src="'.$image .'" alt="Random image" />'."<br /><br />";
            } else {
                continue;
            }
          }
       ?>

If any query please give a comment

Html Label tag

Html label is very important. When some one try to add radio in a form or other then label tag is important. Example


<form action="demo_form.asp">

<label for="male">Male</label>
 <input type="radio" name="sex" id="male" value="male"><br>
 <label for="female">Female</label>
 <input type="radio" name="sex" id="female" value="female"><br>
 <input type="submit" value="Submit">
 </form>



In this form when some Click “Male” then first radio button will be  check because we use label and important thing is that input radio button id and label “for” will be same. In example first radio id=”male” and label for=”male”

For more details

http://www.w3schools.com/tags/tag_label.asp

Thanks

Resource

Web Development Resource

UI and UX Design

User Interface and User Experience

Tutorial

code,Tips,Tricks in php,mysql,javascript,jquery,ajax,yii,yii2,codeigniter,laravel,drupal,slim,bootstrap,api,jQuery Mobile