2012-08-09 67 views
-3

正在使用幻燈片類似http://tympanus.net/codrops/2010/05/23/fresh-sliding-thumbnails-gallery-with-jquery-php,我想顯示的文件夾中的每個圖像,而不是下拉作爲我努力學習PHP .....請幫如何從目錄中的文件夾中選擇圖像?

+1

學習的東西一般涉及嘗試新事物:關於你的標題"How to select images from a folder?",從這裏開始。發佈您迄今爲止所嘗試的內容,以及您遇到問題的位置。 – Bojangles 2012-08-09 07:57:15

回答

1

第一:這是一個非常具體的問題。發佈你的代碼?你嘗試了什麼?

但是:問這個聽起來挺喜歡「這樣做對我來說」一個問題之前

<?php 

$directory = '.'; // your directory 

$files = scandir($directory); 
$images = array(); 

foreach($files as $file) 
{ 
    $attributes = getimagesize($file); 
    if($attributes) 
    { 
     array_push($images, $file); 
    } 
} 

// An array with your images 
print_r($images); 
相關問題