我有這樣建構的陣列
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
可能嗎?
您需要解析數組數組並建立一個與您要查找的內容相符的新數組。
類似: