我可以将序列化数组保存到数据库,它有一些参考子数组吗?

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

From the docs:

serialize() handles all types, except the resource-type. You can even serialize() arrays that contain references to itself. Circular references inside the array/object you are serializing will also be stored. Any other reference will be lost.

About yout error message, post the line youre calling the "option" index, so we can see what is going wrong...

And as Sammitch said, you can use serialize() to store this data in your DB.