打印带有复选框的数组,需要值

Print array with checkboxes, want the values

我有一个数组,里面有复选框。

每类复选框包含4个选项,您可以随意选择。我不知道如何在不序列化的情况下获取价值。有人可以帮助我吗?

我的数组看起来像这样序列化:

a:4:{i:0;s:1:"5";i:1;s:1:"6";i:2;s:1:"7";i:3;s:1:"8";}

所以我只想要“ ”标签之间的值,我怎样才能得到这个?

你可以试试 unserialize()

$org=unserialize($array)
var_export() 

你应该使用 unserialize.

如果没有,那么试试这个:

$str = 'a:4:{i:0;s:1:"5";i:1;s:1:"6";i:2;s:1:"7";i:3;s:1:"8";}';
preg_match_all(  '/"(\d+)"/', $str, $matches );

print_r($matches[1]);