This question already has an answer here:
I have a form that submits various fields to create a new child job to the parent, but certain information from the parent job needs to be passed to the new job. There are a lot of fields that need to be passed to the new job, so I am wondering if it's possible to pass an array as a hidden field to a form.
I have searched online and found different options, such as passing the array as a concatenation, but I have too many fields to pass over. $job is the array I want to pass.
<form method="post" action="##">
<input type="hidden" name="job" value="<?php echo $job; ?>">
</form>
The error I got with the code above is "array to string conversion", which makes sense, but how do I get around it? There are many fields (probably close to 60) which need to be passed, so doing them one by one is not practical.
Any advice would be much appreciated.
</div>