Home » Javascript, PHP23 October 2009

PHP Javascript : Playing with multi-dimensional array

I had to work on multi-dimensional array with javascript and php. I had a multi-dimensional array in php. I had to load it into javascript array and then populate the html selection list.

The challenge for me was to create multi-dimensional array in javascript and populate selection list with for loop in javascript.

Here is the full code containing php array, creating javascript array, using for loop in javascript to populate selection list in onclick event.

Given php array:-

Creating array in javascript with php array:-

Populating selection list with javascript for loop:-

Download Full Source Code

PHP

Get New Post by Email

Find me on

FacebookTwitterGoogle+LinkedInRSS Feed

Comments are closed.