PHP-based development of the Express Query API interface, can be directly integrated use, interface platform: Express network.
Support format: Json/xml, support more than 300 domestic and foreign courier and Logistics company's Express tracking number query, such as: four-way, Shun Fung, every day, EMS and other (domestic) TNT, DHL, UPS and other (foreign), development interface stability. Can be used for interested learning and communication.
1.kuadidiapi.php
_appkey = $key; }/** * Sets the data return type. 0: Returns the JSON string; 1: Return XML Object * @param number $show */Public Function setshow ($show = 0) {$this->_show = $show; }/** * Sets the number of returned logistics information entries, 0: Returns multiple lines of complete information; 1: Return only one line of information * @param number $muti */Public Function Setmuti ($muti = 0) {$this->_muti = $muti; }/** * Set the return logistics information sort. Desc: Arranged by time from new to old; ASC: Sort by time from old to new * @param string $order */Public Function setorder ($order = ' desc ') {$this->_order = $o Rder; }/** * Inquiry Logistics information, incoming ticket number, * @param logistics number $NU * @param company code $com to inquire about The courier company codes, do not support Chinese, please refer to the courier company code documents. Do not fill the default according to the number of automatic matching company. Note: The number matching success rate is higher than 95%. * @throws Exception * @return Array */Public Function query ($nu, $com = ") {if (Function_exists (' curl_in it ') = = 1) {$url = $this->_apiurl; $DATAARR = array (' id ' = = $this->_appkey, ' com ' + = $com, ' nu ' = = $nu, ' Show' = = $this->_show, ' muti ' and ' $this->_muti, ' order ' and $this->_order ); foreach ($dataArr as $key = = $value) {$url. = $key. '=' . $value. "&"; }//Echo $url; $curl = Curl_init (); curl_setopt ($curl, Curlopt_url, $url); curl_setopt ($curl, Curlopt_header, 0); curl_setopt ($curl, Curlopt_returntransfer, 1); curl_setopt ($curl, Curlopt_timeout, 10); $kuaidresult = curl_exec ($curl); Curl_close ($curl); if ($this->_show = = 0) {$result = Json_decode ($kuaidresult, true); }else{$result = $kuaidresult; } return $result; }else{throw new Exception ("Please install Curl plugin", 1); } }}