CakeFest 2024: The Official CakePHP Conference

SplFileInfo::isReadable

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

SplFileInfo::isReadableComprueba si el fichero se puede leer

Descripción

public SplFileInfo::isReadable(): bool

Comprueba si el fichero se puede leer.

Parámetros

Esta función no tiene parámetros.

Valores devueltos

Devuelve true si se puede leer, en caso contrario false.

Ejemplos

Ejemplo #1 Ejemplo de SplFileInfo::isReadable()

<?php
$info
= new SplFileInfo('readable.jpg');
if (
$info->isReadable()) {
echo
$info->getFilename() . ' is readable';
}
?>

El resultado del ejemplo sería algo similar a:

readable.jpg is readable

add a note

User Contributed Notes

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