I wish to store an arbitrary number of answers to a question on a form in a single field (json).
So the inputs may be something like:
Your Jobs:
- job title
- start date
- end date
I know I can call the input <input name="job_title[]">
and these would all be listed as an array under job_title
. But is there anyway to have all three inputs listed under a keyed array just by naming the inputs in a specific way, something like:
[jobs => [['job_title' => 'xyz', 'start_date` => 'xyz', 'send_date` => 'xyz'], ....]
Or would I need to build this manually in php with loops?