The PHP code I am interating through is as follows for the Update process:
$data = $_POST;
foreach ($data['answers'] as &$d):
if(!isset($d['default'])):
$d['default'] = "false";
endif;
endforeach;
And when I var_dump it after that iteration, I get the following:
array(2) {
["question"]=>
string(20) "Which did you like?"
["answers"]=>
array(6) {
[0]=>
array(2) {
["default"]=>
string(4) "true"
["option"]=>
string(5) "First"
}
[1]=>
&array(2) {
["option"]=>
string(5) "Second"
["default"]=>
string(5) "false"
}
}
}
As you can see, the second array has "&array" keyword, I am assuming that's implying a reference. My question is, can I serialize this array and save it into MYSQL DB? I was getting some data error on the display page after, so I want to make sure if this has anything to do with this.
UPDATE Error message I get on the display page is that Undefined index: option