Return to Snippet

Revision: 9740
at November 19, 2008 10:55 by moonbather


Initial Code
<?php
  if(!function_exists('file_put_contents')) {
    function file_put_contents($filename, $data, $file_append = false) {
      $fp = fopen($filename, (!$file_append ? 'w+' : 'a+'));
        if(!$fp) {
          trigger_error('file_put_contents cannot write in file.', E_USER_ERROR);
          return;
        }
      fputs($fp, $data);
      fclose($fp);
    }
  }
?>

Initial URL
http://drupal.org/node/90713

Initial Description

                                

Initial Title
file_put_contents() fix for php 4

Initial Tags
php, cache

Initial Language
PHP