<?php

/*

I'm trying to turn this:

array{
    truck
    oil_type
    km_min
    km_max
}

into this:

trucks array{
    truck
    truck_data array{
        oil_type
        km_min
        km_max
    }
}

*/


// initial array:
$arr[0]["truck"]    = 2;
$arr[0]["oil_type"] = 2;
$arr[0]["km_min"]     = 345;
$arr[0]["km_max"]     = 567;
$arr[1]["truck"]    = 2;
$arr[1]["oil_type"] = 4;
$arr[1]["km_min"]     = 234;
$arr[1]["km_max"]     = 867;
$arr[2]["truck"]    = 1;
$arr[2]["oil_type"] = 2;
$arr[2]["km_min"]     = 545;
$arr[2]["km_max"]     = 867;
$arr[3]["truck"]    = 4;
$arr[3]["oil_type"] = 3;
$arr[3]["km_min"]     = 45;
$arr[3]["km_max"]     = 567;




?>