PHP query of express information
/*** @ Desc get express information * @ param string $ code Express code * @ param string $ invoice express bill number * @ return mixed $ result ('status', 'info ', 'state', 'data') */function getExpressDelivery ($ code, $ invoice) {$ result = array ('status' => 0, 'info' => 'Unknown error'); $ url = "http://m.kuaidi100.com/query? Type = {$ code} & postid = {$ invoice} & id = 1 & valicode = & temp = ". rand (1,710); $ body = file_get_contents ($ url); // FIXME $ body = json_decode ($ body, true ); $ result ['status'] = $ body ['status'] = 200? 1: 0; $ result ['info'] = $ body ['message']; isset ($ body ['data']) & ($ result ['state'] = $ body ['state']) & ($ result ['data'] = $ body ['data']); return $ result ;}
The above is the content of the PHP query of express information. For more information, please follow the PHP Chinese network (www.php1.cn )!