Page 1 of 1

How to generate a text file using php...?

Posted: Mon Oct 26, 2009 6:28 am
by madhurima
Hi,
Can anyone give me code to generate a text file using php


Thanks in advance,
madhu:)

Re: How to generate a text file using php...?

Posted: Mon Oct 26, 2009 6:47 am
by N1gel
The PHP manual gives details on using the filesystem Filesystem

In the fwrite there is this example of writing a text file

Code: Select all

<?php
$fp = fopen('data.txt', 'w');
fwrite($fp, '1');
fwrite($fp, '23');
fclose($fp);
 
// the content of 'data.txt' is now 123 and not 23!
?>

Re: How to generate a text file using php...?

Posted: Mon Oct 26, 2009 7:23 am
by madhurima
it's working..Thank u so much.. :D