Hello Jaxon,
use serialize() & unserialize() as follows:
$store_in_file=serialize(your_array);
//and store the details of $store_in_file in your file/database.
//while retrieving read the data from file/database into store_in_file and
then use the following.
$retrieve_from_file=unserialize($store_in_file);
$retrieve_from_file will be similar to "your_array"
read the php4.0 & greater manual you will find these functions to be very
helpful..
hope this serves your purpose.
regards
Keyur
$$$$$$$
----- Original Message -----
From: "jaxon" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Monday, April 16, 2001 5:02 AM
Subject: [PHP] store array in a file?
>
> Hey all, can someone make a recommendation here?
>
> 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 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?
> - how to sore the array in a flat file
> - any way to make the array global once loaded?
>
> Thanks for any pointers!
>
> cheers,
> jaxon
>
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
> To contact the list administrators, e-mail: [EMAIL PROTECTED]
>
>
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]