Re: PHP Array to Javascript?

From: Date: Thu, 26 Aug 2004 18:33:19 +0000
Subject: Re: PHP Array to Javascript?
References: 1  Groups: php.db 
Request: Send a blank email to php-db+get-35900@lists.php.net to get a copy of this message
depending on the size I guess you could run a foreach loop ex. $num = 0; foreach ($ringb as $val) { print "x[$num] = '$val';\n"; $num += 1; } so it pretty much just cycles through your array and prints it out in javascript form... "Chris Payne" <chris_payne@planetoxygene.com> wrote in message news:200408260018.i7Q0IJCE008470@ms-smtp-05.tampabay.rr.com... > Hi there everyone, > > > > I set an array using the following in PHP: > > > > $ringb[$i]="$complex_area"; > > $i++; > > > > It cycles through my DB and stores the info, my question is, how can I > convert it to a value that can be read in Javascript? > > > > I'm stumped. > > > > Chris > >

« previous php.db (#35900) next »