Re: PHP Array to Javascript?

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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@xxxxxxxxxxxxxxxxx> wrote in message
news:200408260018.i7Q0IJCE008470@xxxxxxxxxxxxxxxxxxxxxxxxxxxxx
> 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
>
>

-- 
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


[Index of Archives]     [PHP Home]     [PHP Users]     [Postgresql Discussion]     [Kernel Newbies]     [Postgresql]     [Yosemite News]

  Powered by Linux