This is a translated page. The original can be found here: http://iwebdevel.com/2009/06/16/php-get-all-files-and-folders-from-a-directory-folder/
UPDATES VIA RSS | Email GÜNCELLEME VIA RSS | E-posta Get updates via feedburner Get updates via twitter
Home / Coding / PHP / PHP: Get all files and folde… Ana Sayfa / Kodlama / PHP / PHP: tüm dosya ve folde al ...

PHP: Get all files and folders from a directory (folder) PHP: tüm dosya ve klasörleri bir dizin (klasör) uzak dur

Posted on 16. 16 tarihinde gönderildi. Jun, 2009 by Dragos in Coding , PHP Haziran, 2009 Kodlama, PHP ve Dragos tarafından

To get all files and folders from a directory (folder) I found scandir to be the perfect solution. Tüm dosya ve klasörleri bir dizine Ben mükemmel bir çözüm olarak scandir bulundu (klasör) den almak için.

scandir scans a directory and returns an array containing all files and directories under the parent directory we're looking in. scandir bir dizin tarar ve bir dizi üst dizin altında biz arıyoruz in tüm dosyaları ve dizinleri içeren döndürür

The code below will try to remove a directory, if the element is a directory or delete a file, if respectively the element is a file. Eğer eleman bir dizin veya dosya silmek, eğer sırasıyla öğesidir aşağıdaki kodu dizini kaldırmaya çalışırsanız, bir dosyadır.

 $lookin='./home/folder'; $ = arıyorum. / home / klasör ';
$elements=scandir($lookin); $ eleman = scandir ($ lookin);
foreach($elements as $singleEl) { $ singleEl olarak foreach ($ element) (
     if(is_dir($lookin.'/'.$singleEl)) rmdir($lookin.'/'.$singleEl); (is_dir if ($ lookin .'/'.$ singleEl)) rmdir ($ lookin .'/'.$ singleEl);
     else başka
     unlink($lookin.'/'.$singleEl); unlink ($ lookin .'/'.$ singleEl);
} ) 
Translate this post Translate bu yazı


Related posts: Ilgili posta:

  1. Apache & ModRewrite: How to easily deny access to a folder with htaccess Apache & ModRewrite: Nasıl kolayca bir klasöre erişimi reddetmek için htaccess
  2. JavaScript: How to get the index (position within a group) of an object with jQuery? JavaScript: jQuery ile nasıl bir nesnenin (konum bir grup içinde) kütüğü almak için?
  3. JavaScript: Where do I Find All Properties for All HTML Elements ? JavaScript: nereden Tüm HTML Elements Tüm Emlaklar bulabilirim?
  4. PHP: How to get creation time of file with PHP on Linux machines PHP: Linux makinalarda PHP ile dosya oluşturma süreleri elde etmek için
  5. Wordpress: Best SEO iTranslator for Wordpress, get free traffic from fully automated plugin script Wordpress: Wordpress için en iyi SEO iTranslator, tam otomatik eklenti script ücretsiz trafik olsun

    blog comments powered by Disqus Blog Yorumlar Disqus tarafından desteklenmektedir