php-binance-api.php
public function sortDepth(string $symbol, int $limit = 11)
    {
        $bids = $this->depthCache[$symbol]['bids'];
        $asks = $this->depthCache[$symbol]['asks'];
        krsort($bids);
        ksort($asks);
        return [
            "asks" => array_slice($asks, 0, $limit, true),
            "bids" => array_slice($bids, 0, $limit, true),
        ];
    }
public function sortDepth(string $symbol, int $limit = 11)
    {
        $bids = $this->depthCache[$symbol]['bids'];
        $asks = $this->depthCache[$symbol]['asks'];
        krsort($bids);
        ksort($asks);
        return [
            "asks" => array_slice($asks, 0, $limit, true),
            "bids" => array_slice($bids, 0, $limit, true),
        ];
    }
public function sortDepth ( string $ symbol , int $ limit = 11 ) { $ bids = $ this -> depthCache [ $ symbol ] [ 'bids' ] ; $ asks = $ this -> depthCache [ $ symbol ] [ 'asks' ] ; krsort ( $ bids ) ; ksort ( $ asks ) ; return [ "asks" => array_slice ( $ asks , 0 , $ limit , true ) , "bids" => array_slice ( $ bids , 0 , $ limit , true ) , ] ; }
sortDepth Sorts depth data for display & getting highest bid and lowest ask

$sorted = $api->sortDepth($symbol, $limit);

@param $symbol string to sort
@param $limit int depth
@return null
sortDepth Sorts depth data for display & getting highest bid and lowest ask