Posted By

kotnik on 05/09/07


php file write logging

Versions (?)

Who likes this?

2 people have marked this snippet as a favorite


php easy file write

 / Published in: PHP

  1. $myFile = "/tmp/slike.txt";
  2. $fh = fopen($myFile, 'a') or die("can't open file");
  3. fwrite($fh, print_r($povratak_fje));
  4. fclose($fh);

Report this snippet  


RSS Icon Subscribe to comments
Posted By: Roshambo on May 9, 2007

If you're using PHP5 fileputcontents() will do the trick too. Might be faster as it's precompiled into the language.

Posted By: Roshambo on May 9, 2007

Looks like Markdown mangled the method. It should be fileputcontents.

Posted By: Roshambo on May 9, 2007

Hmm, mangled again. One more try:

Posted By: kotnik on May 11, 2007

Yeah, i've put this for easy copy&paste on PHP4 configurations. Thanks for the suggestion ;)

You need to login to post a comment.