Created
May 1, 2012 11:40
-
-
Save level09/2567488 to your computer and use it in GitHub Desktop.
Write file in php
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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; } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment