Current Location: Home> Function Categories> is_readable

is_readable

Determine whether the file exists and is readable
Name:is_readable
Category:File system
Programming Language:php
One-line Description:Determine whether the file is readable.

Definition and usage

is_readable() function determines whether the specified file name is readable.

实例

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

输出:

test.txt is readable

grammar

 is_readable ( file )
parameter describe
file Required. Specify documents to be inspected.

illustrate

Returns TRUE if the file or directory specified by the file exists and is readable.

Similar Functions
  • Read the entire file into an array file

    file

    Readtheentirefileint
  • Read characters from file pointer fgetc

    fgetc

    Readcharactersfromfi
  • Get the file owner fileowner

    fileowner

    Getthefileowner
  • Synchronize changes to files (including metadata) fsync

    fsync

    Synchronizechangesto
  • Get the last access time of the file fileatime

    fileatime

    Getthelastaccesstime
  • Determine whether the file exists and is readable is_readable

    is_readable

    Determinewhetherthef
  • Obtain file permissions fileperms

    fileperms

    Obtainfilepermission
  • Create a new directory mkdir

    mkdir

    Createanewdirectory
Popular Articles