Implementation of the Browse Photos Area >>

Today we will implement the browse photos area of online photoshop

*Those who haven’t seen the online photo editing tool, click on the above icon (baloon) *

You can see the browse area implementation here:

What you need for this is 4 php functions: is_dir , opendir, readdir, filetype

Normal file browsing can be implemented using while loop with above four functions.

See its usage:

if (isdir($dir)){if ($dh = opendir($dir)){ while ( ($file = readdir($dh)) ! false ) { if($file != '.' && $file != '..') { //if it is a directory show folder icon if( filetype($dir .$dirsep. $file) "dir" ) { //display a folder icon here with folder name using img tag } else { // display image here in img tag } } } } }

The whole source code is here: