我在使用update\\u post\\u meta保存多维数组时遇到问题。
这是我的代码($上面设置了meta\\U key和$userID):
$read_notices = get_user_meta($userID, $meta_key);
if (null === $read_notices) {
$read_notices = array();
}
$read_notices[] = $postID;
update_user_meta($userID, $meta_key, $read_notices);
我的问题是,数据每次都在嵌套,所以我最终会。。。有什么想法吗?Array
(
[0] => Array
(
[0] => Array
(
[0] => Array
(
[0] => 1823
)
[1] => 1762
)
[1] => 1762
)
)