[Solved] how to make multidimensional array using my variables


you can by some steps like mentions in code comment :

date_default_timezone_set('UTC');
$start_date = "2018-01-01";
$start_time = "01:30 PM";
$due_date="2018-01-03";
$due_time = "11:30 AM";
$project="10001";
$assign_to="G2E0357";

$glopal_array = array();
$data_array = list_days(strtotime($start_date),strtotime($due_date));// get all days in array
foreach($data_array as $item) {//loop in day array
    $res_arr_values  = array("allocation_date"=>$item,"t_project"=>$project,"t_assign_to"=>$assign_to,"t_start_time"=>$start_time,"t_end_time"=>$due_time);//set up 2d arry with keys
    array_push($glopal_array,$res_arr_values);//push the array the global array
}
echo "<pre>";
print_r($glopal_array);//print glopal array
echo "</pre>";


function list_days($date_from,$date_to){
    $arr_days = array();
    $arr_days[] = date('o-m-d',$date_from);
    $day_passed = ($date_to - $date_from); //seconds
    $day_passed = ($day_passed/86400); //days

    $counter = 1;
    $day_to_display = $date_from;
    while($counter < $day_passed){
        $day_to_display += 86400;
        //echo date("F j, Y \n", $day_to_display);
        $arr_days[] = date('o-m-d',$day_to_display);
        $counter++;
    }
    $arr_days[] = date('o-m-d',$date_to);

    return $arr_days;
}

Output:

enter image description here

solved how to make multidimensional array using my variables