Posted By

moonbather on 11/19/08


Tagged

php cache


Versions (?)

file_put_contents() fix for php 4


 / Published in: PHP
 

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

  1. <?php
  2. if(!function_exists('file_put_contents')) {
  3. function file_put_contents($filename, $data, $file_append = false) {
  4. $fp = fopen($filename, (!$file_append ? 'w+' : 'a+'));
  5. if(!$fp) {
  6. trigger_error('file_put_contents cannot write in file.', E_USER_ERROR);
  7. return;
  8. }
  9. fputs($fp, $data);
  10. fclose($fp);
  11. }
  12. }
  13. ?>

Report this snippet  

Comments

RSS Icon Subscribe to comments
Posted By: Pramodkumar121 on November 20, 2008

www.jagara

You need to login to post a comment.