Re: Newbie - Spot the error

From: Date: Wed, 15 May 2002 11:13:31 +0000
Subject: Re: Newbie - Spot the error
References: 1 2  Groups: php.general 
Request: Send a blank email to php-general+get-97693@lists.php.net to get a copy of this message
If I // $time=="21" the count goes up by 1 so it's not recognizing the 21. Any ideas "Olav bringedal" <raist100@yahoo.com> wrote in message news:20020515110018.72619.qmail@web10507.mail.yahoo.com... > --- Josh Edwards <josho@tpg.com.au> wrote: > if I > have $time = 21 then > > > > $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] ; > > > > I get 0 > > > > It might be "= =" which should be "==". If not, try: > > $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") > { > echo "before:".$timespread[22]."<b>" ; > $timespread[22]=($timespread[22]+1); > echo "after:".$timespread[22]."<b>" ; > } > else > { > echo "time is not 21" ; > } > > Then you can at least establish where things go wrong. > > > > > ===== > Olav Bringedal > jaggu.org > > __________________________________________________ > Do You Yahoo!? > Everything you'll ever need on one web page > from News and Sport to Email and Music Charts > http://uk.my.yahoo.com

« previous php.general (#97693) next »