On Fri, 15 Mar 2002, Philip J. Newman wrote:
> can someone point me in the right direction for writing data to a file.
> 
> d:/site/file.txt
> 
> infomation:
> 
> [DATE] Information

  $information = 'Some information';
  $filename = 'd:/site/file.txt';

  if ((is_writable($filename) || !file_exists($filename))
    && $fp = @fopen($filename, 'a'))
  {
    fputs($fp, date('[d-M-Y] ') . $information . "\n");
    fclose($fp);
  }
  else
  {
    print "Unable to open {$filename} for output";
  }

Look up fopen, fputs, fclose in the manual for more details on what's 
going on here.

miguel


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

Reply via email to