CakeFest 2024: The Official CakePHP Conference

glob://

glob://Kalıpla eşleşen dosya yollarını bulur

Açıklama

glob: akım sarmalayıcısı.

Kullanımı

  • glob://

Seçenekler

Sarmalayıcı Seçenekleri
Özellik Destek
allow_url_fopen ile sınırlı Hayır
allow_url_include ile sınırlı Hayır
Okuma izni Hayır
Yazma izni Hayır
Ekleme izni Hayır
Aynı anda okuma ve yazma izni Hayır
stat() desteği Hayır
unlink() desteği Hayır
rename() desteği Hayır
mkdir() desteği Hayır
rmdir() desteği Hayır

Örnekler

Örnek 1 - Temel kullanım

<?php
// ext/spl/examples/ dizinideki tüm *.php dosyalarını al
// hepsinin dosya ismini ve boyutunu bas

$it = new DirectoryIterator("glob://ext/spl/examples/*.php");
foreach(
$it as $f) {
printf("%s: %.1FK\n", $f->getFilename(), $f->getSize()/1024);
}
?>
tree.php: 1.0K
findregex.php: 0.6K
findfile.php: 0.7K
dba_dump.php: 0.9K
nocvsdir.php: 1.1K
phar_from_dir.php: 1.0K
ini_groups.php: 0.9K
directorytree.php: 0.9K
dba_array.php: 1.1K
class_tree.php: 1.8K
add a note

User Contributed Notes 2 notes

up
-1
Hemanth VSR
6 days ago
// this is an example for Darwin (iOS) file system

<?php
$it
=new DirectoryIterator("glob:///Users/hybrid/projects/backupfiles/*.py");

print(
"\nHere's is the example for memory occupied in kilobytes"."\n\n");
foreach(
$it as $f) {

// output in kilobytes
printf("%s: %.1FK\n", $f->getFilename(), $f->getSize()/1024);
}

print(
"\nHere's is the example for memory occupied in bytes"."\n\n");
foreach(
$it as $f) {

// output in kilobytes
printf("%s: %.1FK\n", $f->getFilename(), $f->getSize());
}

?>
up
-1
Hemanth VSR
6 days ago
// this is an example for Darwin (iOS) file system

<?php
$it
=new DirectoryIterator("glob:///Users/hybrid/projects/backupfiles/*.py");

print(
"\nHere's is the example for memory occupied in kilobytes"."\n\n");
foreach(
$it as $f) {

// output in kilobytes
printf("%s: %.1FK\n", $f->getFilename(), $f->getSize()/1024);
}

print(
"\nHere's is the example for memory occupied in bytes"."\n\n");
foreach(
$it as $f) {

// output in kilobytes
printf("%s: %.1FK\n", $f->getFilename(), $f->getSize());
}

?>
To Top