[nycphp-talk] how to pass array from php to javascript
chad qian
nynj.tech at hotmail.com
Sat Sep 13 10:42:47 EDT 2008
How to pass array from php to javascrip?thanks! Here is my sample code:<?phprequire "include/connection.php";//$menu_name=$_GET['menus'];//$menulist= array("Peter", "Joe", "Glenn", "Cleveland");//reset($menulist);$menulist=array();$q="select name from menus";$result=mysql_query($q);while($row=mysql_fetch_array($result)){$name=$row['name'];array_push($menulist,'$name');}?><script type="text/javascript">var menu1=new Array().............//I want to copy array menulist to menu1,how to program here?I want the menu1 to be the same as menulist</script>
_________________________________________________________________
See how Windows Mobile brings your life together—at home, work, or on the go.
http://clk.atdmt.com/MRT/go/msnnkwxp1020093182mrt/direct/01/
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.nyphp.org/pipermail/talk/attachments/20080913/efe360d6/attachment.html>
More information about the talk
mailing list