SplFileInfo::getSize

(PHP 5 >= 5.1.2, PHP 7, PHP 8)

SplFileInfo::getSizeGets file size

Açıklama

publicSplFileInfo::getSize(): int|false

Returns the filesize in bytes for the file referenced.

Bağımsız Değişkenler

Bu işlevin bağımsız değişkeni yoktur.

Dönen Değerler

The filesize in bytes on success, or false on failure.

Hatalar/İstisnalar

A RuntimeException will be thrown if the file does not exist or an error occurs.

Örnekler

Örnek 1 SplFileInfo::getSize() example

<?php
$info
= new SplFileInfo('example.jpg');
echo
$fileinfo->getFilename() . " " . $fileinfo->getSize();
?>

Yukarıdaki örnek şuna benzer bir çıktı üretir:

example.jpg 15385

Ayrıca Bakınız

To Top