For Programmers: Free Programming Magazines  


Home > Archive > PHP DB > August 2004 > Re: [PHP-DB] PHP Array to Javascript?









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: [PHP-DB] PHP Array to Javascript?
Ramil Sagum

2004-08-25, 8:55 pm

On Wed, 25 Aug 2004 20:18:23 -0400, Chris Payne
<chris_payne@planetoxygene.com> wrote:
> 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
>


Output javascript code in HTML that would assign values to variables.
Asimple example would be

<script>

var x;

x = <?php echo $valueofX; ?>;
</script>


HTH
----

ramil

http://ramil.sagum.net
Sponsored Links







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

Copyright 2008 codecomments.com