I am looking to see if this is possible.
I am looking to post a an array of multiple values to a server using PHP as a middleware. I have a mobile app where the user will complete a questionnaire. I am wanting to post the question, answer and date for each question in one api call.
Is it possible to POST and deal with an array of values. Something like answers = [[question,answer,date],[question,answer,date],[question,answer,date],[question,answer,date]]
Any thoughts or best practices please do post below.
Update: if possible can you an example or link would be fab!
You can do this a couple of different ways. The first way would be to post an array and access it like so:
The second way would be to send a
jsonstring and to decode it in PHP:The method you choose really comes down to which way it is easiest for you to send the data.