File Put Contents


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

Similar to the file_put_contents() function in PHP5 built for PHP4 (will not cause errors on a server running PHP5).


Copy this code and paste it in your HTML
  1. if (!function_exists('file_put_contents')) {
  2.  
  3. function file_put_contents($file, $contents = '', $method = 'a+') {
  4.  
  5. $file_handle = fopen($file, $method);
  6.  
  7. fwrite($file_handle, $contents);
  8.  
  9. fclose($file_handle);
  10.  
  11. return true;
  12.  
  13. }
  14.  
  15. }

Report this snippet


Comments

RSS Icon Subscribe to comments

You need to login to post a comment.