Re: Storing values in arrays

From: Date: Thu, 18 Jan 2007 23:34:39 +0000
Subject: Re: Storing values in arrays
References: 1  Groups: php.general 
Request: Send a blank email to php-general+get-247372@lists.php.net to get a copy of this message
Robert Cummings <robert@interjinn.com> wrote: On Wed, 2007-01-17 at 07:15 -0800, Ryan A wrote: > > Hey! > > Thanks for replying. > > > > Instead of CRON i was thinking of having a file created and check the > > creation time everytime someone logged in... if its less than 1 min > > then don't do anything, if 1 min or more old... write file... > > But then it wouldn't be written to disk every one minute if someone > didn't log in for 3 minutes ;) > > True, but thats not the most important part... I guess I wrote it wrong, I meant that it should > not write to disk before 1 minute... > anyway... about the "array saving" any ideas? // untested if( ($fptr = fopen( '/tmp/mySavedArray.dat', 'wb' )) !== false ) { fwrite( $fptr, serialize( $myArray ) ); fclose( $fptr ); } ?> There's also file_put_contents() but I generally go with backward compatible methods. Thanks, will give it a go! Cheers! R ------ - The faulty interface lies between the chair and the keyboard. - Creativity is great, but plagiarism is faster! - Smile, everyone loves a moron. :-) --------------------------------- Need a quick answer? Get one in minutes from people who know. Ask your question on Yahoo! Answers.

« previous php.general (#247372) next »