PHP Write to file


/ Published in: PHP
Save to your folder(s)



Copy this code and paste it in your HTML
  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; }

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

Report this snippet


Comments

RSS Icon Subscribe to comments

You need to login to post a comment.