array_multisort不能正常使用PHP

Please i need your help. I want to sort the array into an ascending order by priority time.

Heres is the array

Array
(
    [process] => Array
        (
            [0] => Array
                (
                    [name] => p1
                    [burst_time] => 2
                    [priority_time] => 3
                )

            [1] => Array
                (
                    [name] => p2
                    [burst_time] => 2
                    [priority_time] => 4
                )

            [2] => Array
                (
                    [name] => p3
                    [burst_time] => 2
                    [priority_time] => 1
                )

        )

)

I tried this code but doesn't work for me. Thank you in advanced :)

foreach ($data as $key => $row) {
    $mid[$key]  = $row;
}
array_multisort($mid, SORT_ASC, $data);

You're using array_multisort but you don't need to sort in multiple dimensions. A simple usort is enough:

$data = array(
    "process" => array(
        array(
            "name" => p1,
            "burst_time" => 2,
            "priority_time" => 3
        ), array(
            "name" => p2,
            "burst_time" => 2,
            "priority_time" => 4
        ), array(
            "name" => p3,
            "burst_time" => 2,
            "priority_time" => 1
        )
    )
);

usort($data["process"], "sort_by_priority_time");

function sort_by_priority_time($a, $b) {
    return $a["priority_time"] - $b["priority_time"];
}

I got it working. Thank you guys for your help.

I changed it to. And finally it works.

foreach ($data['process'] as $key => $row) {
    $mid[$key]  = $row;
}
array_multisort($mid, SORT_ASC, $data['process'] );

</div>