我有这样构建的数组
array (size=2) 0 => array (size=12) 'id_objects' => string '2876' (length=4) 'room_val' => string '1882840,1882841,1882842' (length=23) 'date_from' => string '2022-06-22' (length=10) 'date_to' => string '2022-06-22' (length=10) 1 => array (size=12) 'id_objects' => string '2876' (length=4) 'room_val' => string '3198723,3198724,3198726' (length=23) 'date_from' => string '2022-06-22' (length=10) 'date_to' => string '2022-06-22' (length=10)
我需要实现的是,爆炸'room_val'但保持其余数据相同,它需要看起来像这样
array (size=2) 0 => array (size=12) 'id_objects' => string '2876' (length=4) 'room_val' => string '1882840' (length=23) 'date_from' => string '2022-06-22' (length=10) 'date_to' => string '2022-06-22' (length=10) 1 => array (size=12) 'id_objects' => string '2876' (length=4) 'room_val' => string '1882841' (length=23) 'date_from' => string '2022-06-22' (length=10) 'date_to' => string '2022-06-22' (length=10) ..... rest of array
可能吗?
您需要解析数组数组并创建一个与您要查找的内容匹配的新数组。
类似于: