On Wed, 15 May 2002, Josh Edwards wrote: > $timespread =array(0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0); > if ($time = = "21") > $timespread[22]=($timespread[22]+1); > echo $timespread[22] ;
It should be ==, not = =. Secondly, you don't need to quote the 21, it's a number. You should use PHP's array_fill function to make your array of 0's. Finally, remember the ++ syntax, too. Try this: $timespread = array_fill(0, 24, 0); if ($time == 21) $timespread[22]++; echo $timespread[22]; -- +-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-+ | Shaun M. Thomas INN Database Administrator | | Phone: (309) 743-0812 Fax : (309) 743-0830 | | Email: [EMAIL PROTECTED] AIM : trifthen | | Web : www.townnews.com | | | | "Most of our lives are about proving something, either to | | ourselves or to someone else." | | -- Anonymous | +-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-+ -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php