I'm trying to parse JSON data from a jquery form which is dynamically created. Users can click the "add step" button to add as many (or as few) form fields as they like (including attaching media links), but I have no idea how to process such data within PHP. Here's some sample form $_POST data I'm expecting to receive:
Array
(
[1] => Array //1, 2, 3, 4 are the position for this particular 'step' on the page
(
[Counter] => 1
[Title] => step one
[Step] => description
[Links] => Array
(
[0] => link 1
[1] => link 2
)
)
[2] => Array
(
[Counter] => 2
[Title] => step two
[Step] => some kind of description
[Links] => Array
(
[0] => link 2
)
)
[3] => Array
(
[Counter] => 3
[Title] => step three
[Step] => description (another one)
)
[4] => Array
(
[Counter] => 4
[Title] => Step four
[Step] => a lame description
[Links] => Array
(
[0] => link 1
[1] => link 2
)
)
[tutorial_name] => tutorial name? jesus?
[tutorial_description] => some useless description
[tutorial_toolsused] => waste of a tools used
[tutorial_keywords] => waste of keywords
)
Any idea how I could best go about processing such data (regex, foreach) ? Should I avoid using the post protocol?
Any help would be greatly appreciated!
json_decode().$_POSTare thenameattributes of the inputs, do you really havename='1[Counter]'?