Re: [PHP] Saving to a file
At 20.06.2001 09:04, Rosen wrote: >Hi, >Sorry for the stupid question, but i don't have at me a PHP manual >and I want to save some string to file from PHP. > > >Can someone tell me how ( with what function to do this ) ? > > >Thanks >Rosen fopen() [http://www.php.net/manual/en/function.fopen.php] and fwrite() fread() and so on... the manual i online, so there is no excuse for asking silly questions like this. -- Andreas D Landmark / noXtension Real Time, adj.: Here and now, as opposed to fake time, which only occurs there and then. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
RE: [PHP] Saving to a file
Rosen, Depends on where you want to save the file. To get the manual http://www.php.net/docs.php. To Save to a file on the machine running the browser; make a form that outputs absolutely nothing except; header("Content-Type: application/octet-stream"); header("Content-Disposition: attachment; filename=filename.txt"); while(list($key,$val) = each($prod)) { // the echo below sends the file contents $id = $val[0]; // data was loaded to array $prod as follows; $nm = $val[1]; // $prod[] = array($productNo, $productDescr); echo("$id,$nm\r\n");// use \r\n if going to windows browser \n if going to unix } To Save a file to the server machine hosting your website; use normal fopen, fputs, etc (see the manual) good luck, Warren Vail -Original Message- From: Rosen [mailto:[EMAIL PROTECTED]] Sent: Wednesday, June 20, 2001 1:04 AM To: [EMAIL PROTECTED] Subject: [PHP] Saving to a file Hi, Sorry for the stupid question, but i don't have at me a PHP manual and I want to save some string to file from PHP. Can someone tell me how ( with what function to do this ) ? Thanks Rosen
Re: [PHP] Saving to a file
On Wed, Jun 20, 2001 at 11:04:21AM +0300, Rosen wrote: > Sorry for the stupid question, but i don't have at me a PHP manual > and I want to save some string to file from PHP. > > Can someone tell me how ( with what function to do this ) ? fopen http://www.php.net/manual/en/function.fopen.php fputs http://www.php.net/manual/en/function.fputs.php fclose http://www.php.net/manual/en/function.fclose.php -- Jason Stechschulte [EMAIL PROTECTED] -- All language designers are arrogant. Goes with the territory... :-) -- Larry Wall in <[EMAIL PROTECTED]