30 Ekim 2014, 07:30
|
#1 |
Çevrimdışı
Kullanıcıların profil bilgileri misafirlere kapatılmıştır.
| opendir komutu yerine glob kullanımı
PHP Kod: Kodu kopyalamak için üzerine çift tıklayın!
$dir = './';
foreach(glob($dir.'*.txt') as $file) {
print $file . "\n";
}
/* returns:
./dummy.txt
./foo.txt
./ideas.txt
./robots.txt
./scite.txt
*/
/*
** other examples:
*/
// also possible:
$files = glob('*.*');
sort($files);
// This shows how to use the GLOB_BRACE flag:
$images = glob("images/{*.jpg,*.gif,*.png}", GLOB_BRACE);
print_r($images);
/* Valid flags:
GLOB_MARK
GLOB_NOSORT
GLOB_NOCHECK
GLOB_NOESCAPE
GLOB_BRACE
GLOB_ONLYDIR
GLOB_ERR
see PHP.net manual for more info
*/
__________________ |
| |