0) { while(list ($key) = each ($array_to_search)) { $all_files[] = basename($array_to_search[$key]['path']); //echo basename($array_to_search[$key]['path']).'
'; } } // storing the extension of all the documents in an array // and checking if there is a .jpg, .jpeg, .gif or .png file // if this is the case a slideshow can be made. $all_extensions=array(); $image_present=0; if ( count($all_files) > 0 ) { foreach ($all_files as $file) { $slideshow_extension=strrchr($file,"."); $slideshow_extension=strtolower($slideshow_extension); $all_extensions[]=$slideshow_extension; if ($slideshow_extension==".jpg" OR $slideshow_extension==".jpeg" OR $slideshow_extension==".gif" or $slideshow_extension==".png") { $image_present=1; $image_files_only[]=$file; } } } $_SESSION["image_files_only"]=$image_files_only; ?>