Current Location: Home> Function Categories> is_writable

is_writable

Determine whether the given file name is writable
Name:is_writable
Category:File system
Programming Language:php
One-line Description:Determine whether the file is writable.

Definition and usage

is_writable() function determines whether the specified file is writable.

实例

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

输出:

test.txt is writeable

grammar

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

illustrate

Return true if the file exists and is writable. The file parameter can be a directory name that allows for writable checks.

Similar Functions
  • Determine whether the given file name is a symbolic connection is_link

    is_link

    Determinewhethertheg
  • Match file names with pattern fnmatch

    fnmatch

    Matchfilenameswithpa
  • Read characters from file pointer fgetc

    fgetc

    Readcharactersfromfi
  • Parsing configuration strings parse_ini_string

    parse_ini_string

    Parsingconfiguration
  • Return the target of the symbolic link readlink

    readlink

    Returnthetargetofthe
  • Get file information through the opened file pointer fstat

    fstat

    Getfileinformationth
  • Determine whether the given file name is a directory is_dir

    is_dir

    Determinewhethertheg
  • Open process file pointer popen

    popen

    Openprocessfilepoint
Popular Articles