passing arrays from php(zend) to javascript and back!!

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
cali_dotcom
Forum Commoner
Posts: 49
Joined: Fri Aug 22, 2008 7:28 pm
Location: Rancho Cucamonga, CA

passing arrays from php(zend) to javascript and back!!

Post by cali_dotcom »

hi,
i'm trying to figure out how to pass arrays back and forth from php to javascript and back in the zend framework. i need to do this for check boxes.
can anyone help me out
Darkzaelus
Forum Commoner
Posts: 94
Joined: Tue Sep 09, 2008 7:02 am

Re: passing arrays from php(zend) to javascript and back!!

Post by Darkzaelus »

to pass arrays forward to JS, you have to echo them in the correct format in HTML script tags.
to pass arrays back to PHP, if you want to do it over the same page, you have to use AJAX, if you want to allow refreshes, use forms.

Darkzaelus
mmj
Forum Contributor
Posts: 118
Joined: Fri Oct 31, 2008 4:00 pm

Re: passing arrays from php(zend) to javascript and back!!

Post by mmj »

If you're PHP ver supports it then use json.
Post Reply