I want to pass a javascript array to a php page using ajax POST request .How to achieve this.please help..Thanks in advance
Have a look into JSON encoding. In PHP you can decode it using json_decode, not quite sure how you'll encode it in Javascript but it is possible |
|||
|
using jQuery
Edit if you are creating ajax object and using it then I'll suggest to convert your data in query string send it through ajax object. like :
|
|||||||||
|
example posting with json
Then the json could be parsed server side. arrays can also be sent using application/x-www-form-urlencoded - this is the default format for submitting. |
|||
|