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; }


Report this snippet


RSS Icon Subscribe to comments

You need to login to post a comment.