DirectoryIterator::getSize

(PHP 5)

DirectoryIterator::getSizeGet size of current DirectoryIterator item

Опис

public int DirectoryIterator::getSize ( void )

Get the file size for the current DirectoryIterator item.

Параметри

В цієї функції немає параметрів.

Значення, що повертаються

Returns the size of the file, in bytes.

Приклади

Приклад #1 DirectoryIterator::getSize() example

<?php
$iterator 
= new DirectoryIterator(dirname(__FILE__));
foreach (
$iterator as $fileinfo) {
    if (
$fileinfo->isFile()) {
        echo 
$fileinfo->getFilename() . " " $fileinfo->getSize() . "\n";
    }
}
?>

Наведений вище приклад виведе щось подібне до:

apple.jpg 15385
banana.jpg 15190
example.php 170
pear.jpg 34406

Прогляньте Також

add a note add a note

User Contributed Notes

There are no user contributed notes for this page.
To Top