Posted By

disc0nnect on 07/29/09


Tagged

php write fopen


Versions (?)

Who likes this?

4 people have marked this snippet as a favorite

irishsk
umang_nine
BrianCoyDesign
userpiv


PHP Write to file


 / Published in: PHP
 

URL: http://www.jonasjohn.de/snippets/php/write.htm

  1. function write($path, $content, $mode="w+"){ if (file_exists($path) && !is_writeable($path)){ return false; } if ($fp = fopen($path, $mode)){ fwrite($fp, $content); fclose($fp); } else { return false; } return true; }

Report this snippet  

You need to login to post a comment.