Implementation of file_put_contents for PHP4





7
Date Submitted Fri. Oct. 14th, 2005 6:10 AM
Revision 1 of 1
Helper lilleman
Tags File | Folder | PHP | Write
Comments 1 comments
Implementation of file_put_contents for PHP4
<?php

function file_put_contents($filename, $data)
{
  if( $file = fopen($filename, 'w') )
  {
    $bytes = fwrite($file, is_array($data) ? implode('', $data) : $data);
    fclose($file); return $bytes; // return the number of bytes written to the file
  }
}

?>

Erik Riklund

phofer.com

Comments

Comments PHP_Compat
Tue. Aug. 8th, 2006 7:21 PM    Beginner schmalls

Voting