Re: save to file

From: Date: Sat, 08 Mar 2003 23:39:30 +0000
Subject: Re: save to file
References: 1  Groups: php.general 
Request: Send a blank email to php-general+get-138796@lists.php.net to get a copy of this message
At 00:30 09.03.2003, Ryan Holowaychuk said: --------------------[snip]-------------------- >So right now the implode puts everything on one line in the text file!!! > >So I am no sure if anybody can shed some light on this one. > >Thanks again >Ryan > ><? >//create a new file > $fp = fopen("/place/on/server/" . $HTTP_POST_VARS['team'] , > "w"); > > $file_data = implode("\t\", $_POST); >//this would return values spit by tabs >//write to the open file handle > fwrite($fp, $file_data . "\r\n"); >//close the file > fclose($fp); --------------------[snip]-------------------- The implode statement will indeed create a single line, that's what you tell it to do... if you want a line per value, you need to specify the newline separator, such as implode("\n", $_POST); Or am I off topic? -- >O Ernest E. Vogelsinger (\) ICQ #13394035 ^ http://www.vogelsinger.at/

« previous php.general (#138796) next »