[PHP] How to put a new line character with fputs($birthday_file, $content);
Hi, I am saving the result of a query on a text file. Then I want to open it with excel. At the moment, when I open it with excel, all results appear in one very long line. How could I insert a new line character at the end of each record? Thanks Alfredo -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] How to put a new line character with fputs($birthday_file,$content);
On Fri, 21 Jun 2002, Alfredo wrote: Hi, I am saving the result of a query on a text file. Then I want to open it with excel. At the moment, when I open it with excel, all results appear in one very long line. How could I insert a new line character at the end of each record? Unix considers a line feed to be \n Windows/DOS use \r\n -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] How to put a new line character with fputs($birthday_file,$content);
\n is a newline character, \r is a carriage return. $line = This is a line with a newline character.\n; You can find it in the manual here: http://www.php.net/manual/en/language.types.string.php mh. On Fri, 21 Jun 2002, Alfredo wrote: Hi, I am saving the result of a query on a text file. Then I want to open it with excel. At the moment, when I open it with excel, all results appear in one very long line. How could I insert a new line character at the end of each record? Thanks Alfredo -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] How to put a new line character with fputs($birthday_file, $content);
I think you can also use \t to separate the data into the various columns needed by excel - Original Message - From: Alfredo [EMAIL PROTECTED] To: [EMAIL PROTECTED] Sent: Friday, June 21, 2002 7:55 PM Subject: [PHP] How to put a new line character with fputs($birthday_file, $content); Hi, I am saving the result of a query on a text file. Then I want to open it with excel. At the moment, when I open it with excel, all results appear in one very long line. How could I insert a new line character at the end of each record? Thanks Alfredo -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php