<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>运达&#039;s  blog &#187; 物流查询</title>
	<atom:link href="https://www.yunda51.com/?feed=rss2&#038;tag=%E7%89%A9%E6%B5%81%E6%9F%A5%E8%AF%A2" rel="self" type="application/rss+xml" />
	<link>https://www.yunda51.com</link>
	<description>运达的博客</description>
	<lastBuildDate>Wed, 12 Nov 2025 07:58:26 +0000</lastBuildDate>
	<language>zh-CN</language>
		<sy:updatePeriod>hourly</sy:updatePeriod>
		<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=4.0.19</generator>
	<item>
		<title>如何实现全国快递物流查询</title>
		<link>https://www.yunda51.com/?p=1970</link>
		<comments>https://www.yunda51.com/?p=1970#comments</comments>
		<pubDate>Sun, 26 Nov 2023 15:02:31 +0000</pubDate>
		<dc:creator><![CDATA[运达]]></dc:creator>
				<category><![CDATA[php技术]]></category>
		<category><![CDATA[php]]></category>
		<category><![CDATA[快递查询]]></category>
		<category><![CDATA[物流查询]]></category>

		<guid isPermaLink="false">http://www.yunda51.com/?p=1970</guid>
		<description><![CDATA[PHP如何实现全国快递物流查询-快递查询 以下代码是测试好的，可以拿去直接使用。 &#60;?php error<a href="https://www.yunda51.com/?p=1970" class="read-more">Continue Reading</a>]]></description>
				<content:encoded><![CDATA[<p>PHP如何实现全国快递物流查询-快递查询<br />
以下代码是测试好的，可以拿去直接使用。</p>
<pre class="wp-code-highlight prettyprint">
&lt;?php
	error_reporting(E_ALL || ~E_NOTICE);
	$host = &quot;https://wuliu.market.alicloudapi.com&quot;;//api访问链接
	$path = &quot;/kdi&quot;;//API访问后缀
	$method = &quot;GET&quot;;
	$appcode = &quot;d923462151414d73a4a16f6a7730bb68&quot;;//开通服务后 买家中心-查看AppCode
	$headers = array();
	array_push($headers, &quot;Authorization:APPCODE &quot; . $appcode);
	// $querys = &quot;no=462319523534879&amp;type=YUNDA&quot;;  //参数写在这里
	$querys = &quot;no=JDVE09474960402&quot;;  //参数写在这里
	$bodys = &quot;&quot;;
	$url = $host . $path . &quot;?&quot; . $querys;
	// echo $url;die;
	$curl = curl_init();
	curl_setopt($curl, CURLOPT_CUSTOMREQUEST, $method);
	curl_setopt($curl, CURLOPT_URL, $url);
	curl_setopt($curl, CURLOPT_HTTPHEADER, $headers);
	curl_setopt($curl, CURLOPT_FAILONERROR, false);
	curl_setopt($curl, CURLOPT_RETURNTRANSFER, true);
	curl_setopt($curl, CURLOPT_HEADER, true);
	if (1 == strpos(&quot;$&quot; . $host, &quot;https://&quot;)) {
	    curl_setopt($curl, CURLOPT_SSL_VERIFYPEER, false);
	    curl_setopt($curl, CURLOPT_SSL_VERIFYHOST, false);
	}
	$out_put = curl_exec($curl);

	$httpCode = curl_getinfo($curl, CURLINFO_HTTP_CODE);
	list($header, $body) = explode(&quot;\r\n\r\n&quot;, $out_put, 2);
	if ($httpCode == 200) {
	    print(&quot;正常请求计费(其他均不计费)&lt;br&gt;&quot;);
	    print($body);
	} else {
	    if ($httpCode == 400 &amp;&amp; strpos($header, &quot;Invalid Param Location&quot;) !== false) {
	        print(&quot;参数错误&quot;);
	    } elseif ($httpCode == 400 &amp;&amp; strpos($header, &quot;Invalid AppCode&quot;) !== false) {
	        print(&quot;AppCode错误&quot;);
	    } elseif ($httpCode == 400 &amp;&amp; strpos($header, &quot;Invalid Url&quot;) !== false) {
	        print(&quot;请求的 Method、Path 或者环境错误&quot;);
	    } elseif ($httpCode == 403 &amp;&amp; strpos($header, &quot;Unauthorized&quot;) !== false) {
	        print(&quot;服务未被授权（或URL和Path不正确）&quot;);
	    } elseif ($httpCode == 403 &amp;&amp; strpos($header, &quot;Quota Exhausted&quot;) !== false) {
	        print(&quot;套餐包次数用完&quot;);
	    } elseif ($httpCode == 403 &amp;&amp; strpos($header, &quot;Api Market Subscription quota exhausted&quot;) !== false) {
	        print(&quot;套餐包次数用完，请续购套餐&quot;);
	    } elseif ($httpCode == 500) {
	        print(&quot;API网关错误&quot;);
	    } elseif ($httpCode == 0) {
	        print(&quot;URL错误&quot;);
	    } else {
	        print(&quot;参数名错误 或 其他错误&quot;);
	        print($httpCode);
	        $headers = explode(&quot;\r\n&quot;, $header);
	        $headList = array();
	        foreach ($headers as $head) {
	            $value = explode(&#039;:&#039;, $head);
	            $headList[$value[0]] = $value[1];
	        }
	        print($headList[&#039;x-ca-error-message&#039;]);
	    }
	}
?&gt;
</pre>
<p><strong>详见：</strong><br />
阿里全国物流接口链接：https://market.aliyun.com/products/57126001/cmapi021863.html?userCode=dligum2z</p>
]]></content:encoded>
			<wfw:commentRss>https://www.yunda51.com/?feed=rss2&#038;p=1970</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
	</channel>
</rss>
