Re: [PHP] while loop: detect next loop?

2002-03-28 Thread Tom Rogers
Hi add the newline and white space first like this $data_printed = ""; while ($row = mysql_fetch_assoc($result)) { if($data_printed != ""){ $data_printed .= " \n"; } $data_printed = "" . $row['file_name'] . ""; } That will add to all except the last on

Re: [PHP] while loop: detect next loop?

2002-03-27 Thread Jason Wong
On Thursday 28 March 2002 05:20, Erik Price wrote: > On Wednesday, March 27, 2002, at 04:11 PM, Matt Friedman wrote: > > When you have all your items in an array use implode to add a character > > in between every item. > > > > $str = implode($yourArray, $separator); > > > > This will add the sep

Re: [PHP] while loop: detect next loop?

2002-03-27 Thread Erik Price
On Wednesday, March 27, 2002, at 04:11 PM, Matt Friedman wrote: > When you have all your items in an array use implode to add a character > in between every item. > > $str = implode($yourArray, $separator); > > This will add the separator to the end of each string except the last > one. I like