Filesystem Functions
PHP Manual

is_readable

(PHP 4, PHP 5)

is_readableبررسی وجود و قابلیت خواندن فایل

Description

bool is_readable ( string $filename )

بررسی وجود و قابلیت خواندن فایل.

Parameters

filename

مسیر فایل.

Return Values

بازگرداندن TRUE اگر فایل یا دایرکتوری مشخص شده توسط filename وجود دارد و قابل خواندن است FALSE در غیر این صورت.

Examples

Example #1 مثال is_readable()

<?php
$filename 
'test.txt';
if (
is_readable($filename)) {
    echo 
'The file is readable';
} else {
    echo 
'The file is not readable';
}
?>

Notes

توجه داشته باشید که PHP ممکن است به فایل به عنوان کاربر id اجرای وب سرور (معمولا 'nobody') دسترسی پیدا کند. محدودیت‌های حالت امن پیش از PHP 5.1.5 در نظر گرفته نشده است.

Note: The results of this function are cached. See clearstatcache() for more details.

Tip

As of PHP 5.0.0, this function can also be used with some URL wrappers. Refer to List of Supported Protocols/Wrappers for a listing of which wrappers support stat() family of functionality.

Note:

بررسی با استفاده از UID/GID واقعی به جای شیوه موثر انجام می‌شود.

See Also


Filesystem Functions
PHP Manual