php-binance-api.php
private function depthData(string $symbol, array $json)
    {
        $bids = $asks = [];
        foreach ($json['bids'] as $obj) {
            $bids[$obj[0]] = $obj[1];
        }
        foreach ($json['asks'] as $obj) {
            $asks[$obj[0]] = $obj[1];
        }
        return $this->depthCache[$symbol] = [
            "bids" => $bids,
            "asks" => $asks,
        ];
    }
private function depthData(string $symbol, array $json)
    {
        $bids = $asks = [];
        foreach ($json['bids'] as $obj) {
            $bids[$obj[0]] = $obj[1];
        }
        foreach ($json['asks'] as $obj) {
            $asks[$obj[0]] = $obj[1];
        }
        return $this->depthCache[$symbol] = [
            "bids" => $bids,
            "asks" => $asks,
        ];
    }
private function depthData ( string $ symbol , array $ json ) { $ bids = $ asks = [ ] ; foreach ( $ json [ 'bids' ] as $ obj ) { $ bids [ $ obj [ 0 ] ] = $ obj [ 1 ] ; } foreach ( $ json [ 'asks' ] as $ obj ) { $ asks [ $ obj [ 0 ] ] = $ obj [ 1 ] ; } return $ this -> depthCache [ $ symbol ] = [ "bids" => $ bids , "asks" => $ asks , ] ; }
depthData Formats depth data for nice display

$array = $this->depthData($symbol, $json);

@param $symbol string to display
@param $json array of the depth infomration
@return array of the depth information
depthData Formats depth data for nice display