RE: convert a php arrya to javascript array

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

 



Hello Prabakaran,

What I usually do is to just echo out the values of my PHP array into a
JavaScript array.
This as the JavaScript is read by the browser.

Example:

for ($i=0; $i<count($myArray); $i++)
	{
	echo "\n JS_array[" . $i . "]=" . $myArray[$i] . ";";
	} 

There might be 1000 of better solutions but this works.
BTW. The "\n" is just to make the HTML code more readable if you do a view
source in the browser.

Best regards,
 
Fredrik Davidsson
Systems Consultant
Mobile: +47 92 88 31 45
fdqps@xxxxxxxxxxxxxxx

-----Original Message-----
From: Prabakaran Sekar [mailto:prabakarsekar@xxxxxxxxx] 
Sent: den 24 februari 2005 09:28
Subject:  convert a php arrya to javascript array


Hi all,

I want to convert a php array to java script array any body can me?

Prabakaran


PHP Data object relational mapping generator - http://www.meta-language.net/
Yahoo! Groups Links



 




PHP Data object relational mapping generator - http://www.meta-language.net/ 
Yahoo! Groups Links

<*> To visit your group on the web, go to:
    http://groups.yahoo.com/group/php-objects/

<*> To unsubscribe from this group, send an email to:
    php-objects-unsubscribe@xxxxxxxxxxxxxxx

<*> Your use of Yahoo! Groups is subject to:
    http://docs.yahoo.com/info/terms/
 




[Index of Archives]     [PHP Home]     [PHP Users]     [PHP Soap]     [Kernel Newbies]     [Yosemite]     [Yosemite Campsites]

  Powered by Linux