- Data Structure
- Networking
- RDBMS
- Operating System
- Java
- MS Excel
- iOS
- HTML
- CSS
- Android
- Python
- C Programming
- C++
- C#
- MongoDB
- MySQL
- Javascript
- PHP
- Physics
- Chemistry
- Biology
- Mathematics
- English
- Economics
- Psychology
- Social Studies
- Fashion Studies
- Legal Studies
- Selected Reading
- UPSC IAS Exams Notes
- Developer's Best Practices
- Questions and Answers
- Effective Resume Writing
- HR Interview Questions
- Computer Glossary
- Who is Who
is_writeable() function in PHP
The is_writeable() function checks whether a file is writeable. It returns TRUE if the file exists and is writeable.
The is_writeablle() function is an alias of is_writable(). A benefit of using is_writeable() instead of is_writable() is that the is_writable() function will pollute search results when searching source code for files containing the word "table".
Syntax
is_writeable(file_path)
Parameters
file_path − The path of the file to be checked.
Return
The is_writeable() function returns TRUE if the file exists and is writeable.
Example
<?php $file = "demo.txt"; if(is_writeable($file)) { echo ("File is writeable!"); } else { echo ("File is not writeable!"); } ?>
Output
File is not writeable!
Advertisements