base_url . '/api/v1/ticker/24hr'; $res = $curl->get($api, false);//json if (is_array($res)) { foreach ($res as $item) { $this->redis->sadd($this->supported_symbol, strtolower($item['symbol'])); } } } public function setQuotation() { $curl = new Curl(); $api = $this->base_url . '/api/v1/ticker/24hr'; $res = $curl->get($api, false); if (is_array($res)) { foreach ($res as $item) { $key = $this->quotation_prefix . strtolower($item['symbol']); $this->redis->hmset($key, 'low', $item['lowPrice'], 'high', $item['highPrice'], 'last', $item['lastPrice'], 'open', $item['openPrice'], 'vol', $item['volume']); $this->redis->sadd($this->supported_symbol, $item['symbol']); } } } }