I need to store an array from php into a HTML input hidden field.
PHP Controller :
$docNames = array();
if(!empty($records))
{
foreach($records as $item)
{
array_push($docNames, $item['description']);
}
}
$this->f3->set('docNames', $docNames);
HTML:
<form>
<input type="hidden" name="docNames[]" value="<?php echo $docNames; ?>">
</form>
But I am not being able to do so. How can I store the array?