For Programmers: Free Programming Magazines  


Home > Archive > PHP DB > June 2005 > Re: Subject: Creating an Associative Array









You are viewing an archived Text-only version of the thread. To view this thread in it's original format and/or if you want to reply to this thread please [click here]

 

Author Re: Subject: Creating an Associative Array
dpgirago@mdanderson.org

2005-06-09, 3:56 pm

Thank you kindly, Neil Smith and Brent Baisley.

I now see the error of my approach.

---------------------------------------------------------------------------------------------------------------
$dateArray = array();

> for($counter = 0; $counter <= 3600; $counter++)
> {
> $dateArray[ date("Y.m.d H:i:s", $now - $counter) ] =
> (int)ceil(980 - ($counter * .2333333333333)));
> }

---------------------------------------------------------------------------------------------------------------

works just fine.

note:
Brent, the array(3601) was coming from the $counter loop above and is the
seconds in an hour plus one ( for aesthetic reasons ).

David
Sponsored Links







Also available: Server administration forum archive | Web Design forum archive | Software forum archive | Hardware reviews archive

Copyright 2009 codecomments.com