Re: [PHP] Write an array to a file

2002-01-29 Thread Mike Frazer
More than one way to skin a cat :) The question obviously is whether or not you need to read this data back or if it will be static, unread data. You can use several forms here, including the one below. However, you can use for, while and foreach loops to handle it: /* for (...) method */ $fp

RE: [PHP] Write an array to a file

2002-01-29 Thread Greg Schnippel
Scott - You can just write it as a pipe-delimited file, write it to the file, and then read it back in. Use implode and explode: $company = array("Item 1", "Item 2", "Item 3", "Item 4"); #- # # Output array # $output_string = implode("|", $company)

Re: [PHP] Write an array to a file

2002-01-29 Thread Chris Boget
> How do I write an array to a file? For example, I need to write just this in > a file: > ?> > I've been hung up for 2 days on this. Any help would be appreciated. Use serialize prior to writing the data to the file and unserialize upon retrieval. Chris -- PHP General Mailing List (http://w