Skip to content
Advertisement

Submit form with Ajax in array format, not serialized?

I want to submit a form using Ajax but I want it to be in an array, not serialized.

JavaScript

gives me this in my PHP:

JavaScript

and I have to run this code in PHP to get it into the format I want:

JavaScript

Just seems super unnecessary and I would like to remove that step. How can I just pass the form in an array format? Thanks

Advertisement

Answer

JavaScript

then you will get the $_POST variable like this:

JavaScript
User contributions licensed under: CC BY-SA
9 People found this is helpful
Advertisement