Re: store array in a file?

From: Date: Mon, 16 Apr 2001 00:12:51 +0000
Subject: Re: store array in a file?
References: 1  Groups: php.general 
Request: Send a blank email to php-general+get-48673@lists.php.net to get a copy of this message
Hi jaxon, @ 7:32:10 PM on 4/15/2001, jaxon wrote: ... > I want to keep site structural info pulled from a database in an > array, and store it in a flat file that can eliminate the database > hit. Then you'll be hitting the disk too (really, either way), but I doubt that's going to speed it up very much. > Then I'll just delete the file when structure changes, and regenerate it > with a call to a recreation script that does the necessary sql once. > So > - does this make sense? No, I'm lost. > - how to sore the array in a flat file One way is to implode() the data from an array into a single line (separated by whatever you wish), then write the line to the file on disk. http://www.php.net/manual/en/function.implode.php > - any way to make the array global once loaded? By using global? http://www.php.net/manual/it/language.variables.scope.php -Brian -- PGP is spoken here: 0xE4D0C7C8 Please, DO NOT carbon copy me on list replies.

« previous php.general (#48673) next »