Zend_Json_Encoder::encode()
- $curl = new Varien_Http_Adapter_Curl();
- $curl->setConfig(array('timeout' => 5))->write(Zend_Http_Client::GET, $apiUrl, '1.1');
- $response = $curl->read();
- $httpCode = Zend_Http_Response::extractCode($response);
- if ($httpCode == 200)
- {
- $body = Zend_Http_Response::extractBody($response);
- $tmpData = Zend_Json_Decoder::decode($body);
- if(isset($tmpData['status']) && 'OK' == $tmpData['status']){
- $reservationId = (int)$tmpData['data'];
- }
- }
- return $reservationId;
asdfasfdfa
时间: 2024-11-14 18:07:20