Arbitrary sorting associative array in PHP

I have an associative array that is fetched from Stripe but I want it ordered SILVER first, GOLD second, and the remaining will be in any order.

{
    "platinum": {
        "amount": 100,
        "currency": "usd",
        "interval": "month",
        "name": "platinum",
        "trial_period_days": null
    },
    "gold": {
        "amount": 50,
        "currency": "usd",
        "interval": "month",
        "name": "gold",
        "trial_period_days": null
    },
    "silver": {
        "amount": 10,
        "currency": "usd",
        "interval": "month",
        "name": "silver",
        "trial_period_days": null
    },
    "free": {
        "amount": 0,
        "currency": "usd",
        "interval": "month",
        "name": "free",
        "trial_period_days": null
    }
}

Here’s my solution:

public function caller($unorderedData)
{
    $orderedKeys = ['gold', 'silver'];
    return $this->orderToKeys($unorderedData, $orderedKeys);
}
/**
 * Accepts an associative and sorts it by key according
 * to the second parameter that contains an array of keys.
 *
 * @param $inputArr Array
 * @param $keys Array
 * @return array
 */
private function orderToKeys($inputArr, $keys)
{
    $ordered = [];

    foreach ($keys as $key) {
        if (array_key_exists($key, $inputArr)) {
            $ordered[$key] = $inputArr[$key];
            unset($inputArr[$key]);
        }
    }

    return array_merge($ordered, $inputArr);
}

Now, here’s the output:

{
    "gold": {
        "amount": 50,
        "currency": "usd",
        "interval": "month",
        "name": "gold",
        "trial_period_days": null
    },
    "silver": {
        "amount": 10,
        "currency": "usd",
        "interval": "month",
        "name": "silver",
        "trial_period_days": null
    },
    "platinum": {
        "amount": 100,
        "currency": "usd",
        "interval": "month",
        "name": "platinum",
        "trial_period_days": null
    },
    "free": {
        "amount": 0,
        "currency": "usd",
        "interval": "month",
        "name": "free",
        "trial_period_days": null
    }
}

But what if we want to sort it by amount? Okay, here’s the solution using uasort.

    public function caller($unorderedData)
    {
        return $this->uasortByKey($unorderedData, 'amount');
    }

    private function uasortByKey($arr, $key)
    {
        uasort($arr, function($a, $b) use($key) {
            $aVal = $a[$key];
            $bVal = $b[$key];

            if ($aVal == $bVal) {
                return 0;
            }
            return ($aVal < $bVal) ? -1 : 1;
        });

        return $arr;
    }

And the output will be sorted by amount.

{

    "free": {
        "amount": 0,
        "currency": "usd",
        "interval": "month",
        "name": "free",
        "trial_period_days": null
    },
    "silver": {
        "amount": 10,
        "currency": "usd",
        "interval": "month",
        "name": "silver",
        "trial_period_days": null
    },
    "gold": {
        "amount": 50,
        "currency": "usd",
        "interval": "month",
        "name": "gold",
        "trial_period_days": null
    },
    "platinum": {
        "amount": 100,
        "currency": "usd",
        "interval": "month",
        "name": "platinum",
        "trial_period_days": null
    }

}