<?php $array1 = [ [ 'date' => '12-Jun-18', 'close' => 55.6, ], [ 'date' => '13-Jun-18', 'close' => 58.6, ], ]; $array2 = [ [ 'date' => '12-Jun-18', 'close' => 1.26, ], [ 'date' => '13-Jun-18', 'close' => 2.37, ], ]; $all = array_merge($array1, $array2); foreach ($all as $datapoint) { $result[$datapoint['date']] []= $datapoint['close']; } print_r($result);
You have javascript disabled. You will not be able to edit any code.