<?php $forecastedMonths = [ "May 22", "Jun 22", "Jul 22", "Aug 22", "Sep 22", "Oct 22", "Nov 22", "Dec 22", "Jan 23", "Feb 23", "Mar 23", "Apr 23" ]; $data = [ 1 => 0, 2 => 0, 3 => 0, 4 => 0, 5 => 172427.89, //May 6 => 0, 7 => 243730.79, //Jul 8 => 0, 9 => 0, 10 => 0, 11 => 0, 12 => 0, ]; $result = []; foreach ($forecastedMonths as $My) { $result[] = $data[date('n', strtotime($My))]; } var_export($result);
You have javascript disabled. You will not be able to edit any code.