How to use Filesystem iswritable in PHP

In this article I am going to explain about is_writable function in PHP.
  • 1211

PHP is_writable() Function

The filesystem is_writable function checks whether the specified file is writable.  The function returns true if the filename is exists.

Syntax of is_writable function

is_writable(file,)

Parameters in is_writable function

It has only parameter:

Parameter Description.
file It specifies the file to check.

Example of filesystem is_writable function

<html>

<body>

 

<?php

$file = "C:\wamp\www\Dinesh\Mcn.txt";

if(is_writable($file))

  {

  echo ("$file is writeable");

  }

else

  {

  echo ("$file is not writeable");

  }

?>

 

</body>

</html>

 

Output:

iswritablefunctionphp.jpg

You may also want to read these related articles :
here

Ask Your Question 

Got a programming related question? You may want to post your question here

Programming Answers here

Categories

More Articles

© 2020 DotNetHeaven. All rights reserved.