微信公众平台开发尝试

WBOY
Lepaskan: 2016-08-08 09:26:29
asal
2167 orang telah melayarinya

最近看了一篇博文是说微信公众平台搭建,于是心血来潮自己也尝试了一下。

1.不用多讲了,申请微信公众号,对于个人来说,只能申请订阅号。

可以看这个链接的文章,http://jingyan.baidu.com/article/414eccf6011ff06b431f0aec.html

2.采用的是Sina App Engine来脱管服务,就要申请sae开发者权限。

再看这个链接http://jingyan.baidu.com/article/4f7d57129a60531a20192796.html

3.在sae上新建一个应用

我选择的PHP,PHP几乎免费。Java应用的话,有点小贵了。

虽然没有学过PHP,摸着石头过河吧。

将php代码上传后,就有一个可调试的url了,PHP代码后面上。

4.再在微信公众平台中的开发者中心(这个要经过一段时间的审核),填入一下内容即可

5.然后就是对接数据了,为了测试,我对接的是图灵机器人的数据、12306和百度地图API

12306是为了查余票和车次,百度地图API是为了查天气预报、图灵机器人见链接:http://www.tuling123.com/openapi/

php代码如下,本人不是搞PHP的,因此只能在网上拷贝了,如有复制,纯属巧合。

<span>php
    

    </span><span>define</span>("TOKEN", "weixin"<span>);

    </span><span>Session_start</span><span>();

    </span><span>Session_Register</span>("kw"<span>);


    </span><span>$wechatObj</span> = <span>new</span><span> wechatCallbackapiTest();
    </span><span>require_once</span>("train.php"<span>);

    </span><span>$tqTpl</span> = "<xml> <tousername></tousername> <fromusername></fromusername> <createtime>%s</createtime> <msgtype></msgtype> <articlecount>5</articlecount> <articles> <item> <title></title> <description></description> <picurl></picurl> <url></url> </item> <item> <title></title> <description></description> <picurl></picurl> <url></url> </item> <item> <title></title> <description></description> <picurl></picurl> <url></url> </item> <item> <title></title> <description></description> <picurl></picurl> <url></url> </item> <item> <title></title> <description></description> <picurl></picurl> <url></url> </item> <item> <title></title> <description></description> <picurl></picurl> <url></url> </item> </articles> </xml> "<span>;
    </span><span>if</span> (!<span>isset</span>(<span>$_GET</span>['echostr'<span>])) {
        </span><span>$wechatObj</span>-><span>responseMsg();
    }</span><span>else</span><span>{
        </span><span>$wechatObj</span>-><span>valid();
    }

    </span><span>class</span><span> wechatCallbackapiTest
    {
        </span><span>//</span><span>验证签名</span>
        <span>public</span> <span>function</span><span> valid()
        {
            </span><span>$echoStr</span> = <span>$_GET</span>["echostr"<span>];
            </span><span>$signature</span> = <span>$_GET</span>["signature"<span>];
            </span><span>$timestamp</span> = <span>$_GET</span>["timestamp"<span>];
            </span><span>$nonce</span> = <span>$_GET</span>["nonce"<span>];
            </span><span>$token</span> =<span> TOKEN;
            </span><span>$tmpArr</span> = <span>array</span>(<span>$token</span>, <span>$timestamp</span>, <span>$nonce</span><span>);
            </span><span>sort</span>(<span>$tmpArr</span><span>);
            </span><span>$tmpStr</span> = <span>implode</span>(<span>$tmpArr</span><span>);
            </span><span>$tmpStr</span> = <span>sha1</span>(<span>$tmpStr</span><span>);
            </span><span>if</span>(<span>$tmpStr</span> == <span>$signature</span><span>){
                </span><span>echo</span> <span>$echoStr</span><span>;
                </span><span>exit</span><span>;
            }
        }

        </span><span>//</span><span>响应消息</span>
        <span>public</span> <span>function</span><span> responseMsg()
        {
            </span><span>$postStr</span> = <span>$GLOBALS</span>["HTTP_RAW_POST_DATA"<span>];
            </span><span>if</span> (!<span>empty</span>(<span>$postStr</span><span>)){
                </span><span>$this</span>->logger("R ".<span>$postStr</span><span>);
                </span><span>$postObj</span> = <span>simplexml_load_string</span>(<span>$postStr</span>, 'SimpleXMLElement',<span> LIBXML_NOCDATA);
                </span><span>$RX_TYPE</span> = <span>trim</span>(<span>$postObj</span>-><span>MsgType);
                 
                </span><span>//</span><span>消息类型分离</span>
                <span>switch</span> (<span>$RX_TYPE</span><span>)
                {
                    </span><span>case</span> "event":
                        <span>$result</span> = <span>$this</span>->receiveEvent(<span>$postObj</span><span>);
                        </span><span>break</span><span>;
                    </span><span>case</span> "text":
                        <span>$result</span> = <span>$this</span>->receiveTulingText(<span>$postObj</span><span>);
                        </span><span>break</span><span>;
                    </span><span>case</span> "image":
                        <span>$result</span> = <span>$this</span>->receiveImage(<span>$postObj</span><span>);
                        </span><span>break</span><span>;
                    </span><span>case</span> "location":
                        <span>$result</span> = <span>$this</span>->receiveLocation(<span>$postObj</span><span>);
                        </span><span>break</span><span>;
                    </span><span>case</span> "voice":
                        <span>$result</span> = <span>$this</span>->receiveVoice(<span>$postObj</span><span>);
                        </span><span>break</span><span>;
                    </span><span>case</span> "video":
                        <span>$result</span> = <span>$this</span>->receiveVideo(<span>$postObj</span><span>);
                        </span><span>break</span><span>;
                    </span><span>case</span> "link":
                        <span>$result</span> = <span>$this</span>->receiveLink(<span>$postObj</span><span>);
                        </span><span>break</span><span>;
                    </span><span>default</span>:
                        <span>$result</span> = "unknown msg type: ".<span>$RX_TYPE</span><span>;
                        </span><span>break</span><span>;
                }
                </span><span>$this</span>->logger("T ".<span>$result</span><span>);
                </span><span>echo</span> <span>$result</span><span>;
            }</span><span>else</span><span> {
                </span><span>echo</span> ""<span>;
                </span><span>exit</span><span>;
            }
        }

        </span><span>//</span><span>接收事件消息</span>
        <span>private</span> <span>function</span> receiveEvent(<span>$object</span><span>)
        {
            </span><span>$content</span> = ""<span>;
            </span><span>switch</span> (<span>$object</span>-><span>Event)
            {
                </span><span>case</span> "subscribe":
                    <span>$content</span> = "欢迎关注TomSnail "<span>;
                    </span><span>$content</span> .= (!<span>empty</span>(<span>$object</span>->EventKey))?("\n来自二维码场景 ".<span>str_replace</span>("qrscene_","",<span>$object</span>->EventKey)):""<span>;
                    </span><span>break</span><span>;
                </span><span>case</span> "unsubscribe":
                    <span>$content</span> = "取消关注"<span>;
                    </span><span>break</span><span>;
                </span><span>case</span> "SCAN":
                    <span>$content</span> = "扫描场景 ".<span>$object</span>-><span>EventKey;
                    </span><span>break</span><span>;
                </span><span>case</span> "CLICK":
                    <span>switch</span> (<span>$object</span>-><span>EventKey)
                    {
                        </span><span>case</span> "COMPANY":
                            <span>$content</span> = <span>array</span><span>();
                            </span><span>$content</span>[] = <span>array</span>("Title"=>"多图文1标题", "Description"=>"", "PicUrl"=>"http://discuz.comli.com/weixin/weather/icon/cartoon.jpg", "Url" =>"http://m.cnblogs.com/?u=txw1958"<span>);
                            </span><span>break</span><span>;
                        </span><span>default</span>:
                            <span>$content</span> = "点击菜单:".<span>$object</span>-><span>EventKey;
                            </span><span>break</span><span>;
                    }
                    </span><span>break</span><span>;
                </span><span>case</span> "LOCATION":
                    <span>$content</span> = "上传位置:纬度 ".<span>$object</span>->Latitude.";经度 ".<span>$object</span>-><span>Longitude;
                    </span><span>break</span><span>;
                </span><span>case</span> "VIEW":
                    <span>$content</span> = "跳转链接 ".<span>$object</span>-><span>EventKey;
                    </span><span>break</span><span>;
                </span><span>case</span> "MASSSENDJOBFINISH":
                    <span>$content</span> = "消息ID:".<span>$object</span>->MsgID.",结果:".<span>$object</span>->Status.",粉丝数:".<span>$object</span>->TotalCount.",过滤:".<span>$object</span>->FilterCount.",发送成功:".<span>$object</span>->SentCount.",发送失败:".<span>$object</span>-><span>ErrorCount;
                    </span><span>break</span><span>;
                </span><span>default</span>:
                    <span>$content</span> = "receive a new event: ".<span>$object</span>-><span>Event;
                    </span><span>break</span><span>;
            }
            </span><span>if</span>(<span>is_array</span>(<span>$content</span><span>)){
                </span><span>if</span> (<span>isset</span>(<span>$content</span>[0<span>])){
                    </span><span>$result</span> = <span>$this</span>->transmitNews(<span>$object</span>, <span>$content</span><span>);
                }</span><span>else</span> <span>if</span> (<span>isset</span>(<span>$content</span>['MusicUrl'<span>])){
                    </span><span>$result</span> = <span>$this</span>->transmitMusic(<span>$object</span>, <span>$content</span><span>);
                }
            }</span><span>else</span><span>{
                </span><span>$result</span> = <span>$this</span>->transmitText(<span>$object</span>, <span>$content</span><span>);
            }

            </span><span>return</span> <span>$result</span><span>;
        }

        </span><span>private</span> <span>function</span> receiveTulingText(<span>$object</span><span>){
            </span><span>try</span><span>{
                </span><span>$keyword</span> = <span>trim</span>(<span>$object</span>-><span>Content);
                </span><span>$userid</span> = <span>trim</span>(<span>$object</span>-><span>FromUserName);

                </span><span>$apiKey</span> = "*******************************"<span>; 
                </span><span>$apiURL</span> = "http://www.tuling123.com/openapi/api?key=".<span>$apiKey</span>."&info=".<span>$keyword</span>."&userid=".<span>userid;
                
                
               </span><span>if</span>((<span>substr_count</span>(<span>$keyword</span>,'天气')!=0)||<span>$_SESSION</span>["kw"]=="天气"){  <span>//</span><span>百度地图API</span>
                    <span>if</span>(<span>$keyword</span>=="天气"<span>){
                        </span><span>$_SESSION</span>["kw"]="天气"<span>;
                        </span><span>$content</span> = "请输入城市".<span>$_SESSION</span>["kw"<span>];
                    }</span><span>else</span><span>{
                        </span><span>$geshu</span> = <span>substr_count</span>(<span>$keyword</span>,'天气'<span>);    
                        </span><span>if</span>(<span>$geshu</span>==0<span>){
                            </span><span>$city</span> = <span>$keyword</span><span>;
                        }</span><span>else</span><span>{
                             </span><span>$t</span> = <span>explode</span>("天气",<span>$keyword</span><span>);         
                             </span><span>for</span>(<span>$i</span>=0;<span>$i</span>$geshu;<span>$i</span>++<span>)    
                                {     
                              </span><span>if</span>(<span>$t</span>[<span>$i</span>]!=''<span>)     
                              {     
                            </span><span>$city</span> = <span>$t</span>[<span>$i</span><span>];     
                            </span><span>break</span><span>;     
                              }         
                             }   
                    }
                
                 </span><span>$mykey</span> ="*********************"<span>;   
                 </span><span>$url</span> = "http://api.map.baidu.com/telematics/v3/weather?location=".<span>$city</span>."&output=json&ak=".<span>$mykey</span><span>;    
                 </span><span>$output</span> = <span>file_get_contents</span>(<span>$url</span><span>);    
                 </span><span>$contentStr</span> = json_decode(<span>$output</span>, <span>true</span><span>);        
                       
                 </span><span>if</span>(<span>$contentStr</span>['status']=='success'<span>)    
                 {           
                    </span><span>$T</span>[0]['Title']=<span>$contentStr</span>['date']." ".<span>$contentStr</span>['results'][0]['currentCity']."天气"<span>; 
                    </span><span>$T</span>[0]['PicUrl']="http://zhengwairen-try2.stor.sinaapp.com/xytq.jpg"<span>; 
                    </span><span>$T</span>[0]['Url']="http://zhengwairen-try2.stor.sinaapp.com/xytq.jpg"<span>;     
                    </span><span>if</span>(<span>is_array</span>(<span>$contentStr</span>['results'][0]['index'<span>]))     
                    {     
                        </span><span>$T</span>[2]['Title']="【pm2.5】".<span>$contentStr</span>['results'][0]['pm25']."\n"."【".<span>$contentStr</span>['results'][0]['index'][0]['title']."】"."(".<span>$contentStr</span>['results'][0]['index'][0]['zs'].") ".<span>$contentStr</span>['results'][0]['index'][0]['des'<span>];     
                    </span><span>//</span><span>下一行是洗车指数,感觉不对主题还是不要的好。。     //$T[2]['Title']=$T[2]['Title']."\n"."【".$contentStr['results'][0]['index'][1]['title']."】(".$contentStr['results'][0]['index'][1]['zs'].")".$contentStr['results'][0]['index'][1]['des'];  </span>
                        <span>$T</span>[2]['Title']=<span>$T</span>[2]['Title']."\n"."【".<span>$contentStr</span>['results'][0]['index'][2]['title']."】(".<span>$contentStr</span>['results'][0]['index'][2]['zs'].")".<span>$contentStr</span>['results'][0]['index'][2]['des'<span>];     
                    }     
                    </span><span>else</span>    
                        <span>$guowai</span>=1<span>;  
                    </span><span>for</span>(<span>$i</span>=1,<span>$aaa</span>=0;<span>$i</span>$i++<span>)     
                    {     
                        </span><span>if</span>(<span>$i</span>==2 && <span>$guowai</span>!=1<span>)      
                            </span><span>continue</span><span>;     
                        </span><span>if</span>(<span>$guowai</span>==1 && <span>$i</span>==5<span>)      
                            </span><span>continue</span><span>;     
                        </span><span>$T</span>[<span>$i</span>]['Title']=<span>$contentStr</span>['results'][0]['weather_data'][<span>$aaa</span>]['date']."".<span>$contentStr</span>['results'][0]['weather_data'][<span>$aaa</span>]['temperature']."".<span>$contentStr</span>['results'][0]['weather_data'][<span>$aaa</span>]['weather']." ".<span>$contentStr</span>['results'][0]['weather_data'][<span>$aaa</span>]['wind'<span>];             
                        </span><span>$T</span>[<span>$i</span>]['PicUrl']=<span>$contentStr</span>['results'][0]['weather_data'][<span>$aaa</span>]['dayPictureUrl'<span>];     
                        </span><span>$T</span>[<span>$i</span>]['Url']=<span>$contentStr</span>['results'][0]['weather_data'][<span>$aaa</span>]['dayPictureUrl'<span>];     
                        </span><span>$aaa</span>++<span>;     
                     }      
                     </span><span>$content</span> = <span>$T</span><span>;
                    
                 }     
                    }
                        
                    
                
               }</span><span>else</span> <span>if</span>(<span>substr_count</span>(<span>$keyword</span>,'火车')!=0 && <span>$keyword</span>!='火车'){<span>//</span><span>12306</span>
                    <span>$geshu</span> = <span>substr_count</span>(<span>$keyword</span>,'火车:'<span>); 
                    </span><span>$k</span> = <span>str_replace</span>('火车 ', "", <span>$keyword</span><span>);
                    </span><span>$t</span> = <span>explode</span>(" ",<span>$k</span><span>);
                    </span><span>$startstaion</span> = <span>$t</span>[0<span>];
                    </span><span>$endstation</span> = <span>$t</span>[1<span>];
                    </span><span>$date</span> =<span>$t</span>[2<span>];
                    </span><span>if</span>(<span>$date</span>==<span>null</span><span>){
                        </span><span>$date</span> = <span>date</span>("Y-m-d",<span>time</span><span>());
                    }
                    </span><span>if</span>(<span>substr_count</span>(<span>$date</span>,'-')==0<span>){
                       </span><span>$date</span> = <span>date</span>("Y-m",<span>time</span>())."-".<span>$date</span><span>;
                    }
                    </span><span>$time</span> =<span>$t</span>[3<span>];
                    </span><span>if</span>(<span>$time</span>==<span>null</span><span>){
                        </span><span>$time</span> = "00:00"<span>;
                    }
                    </span><span>if</span>(<span>substr_count</span>(<span>$time</span>,':')==0<span>){
                        </span><span>$time</span> = <span>$time</span>.":00"<span>;
                    }
                    
                    </span><span>$data</span> = gettrain(<span>$startstaion</span>,<span>$endstation</span>,<span>$date</span>,<span>$time</span><span>);
                    </span><span>$str</span>=""<span>;
                    </span><span>$T</span>[0]['Title']=<span>$startstaion</span>."到".<span>$endstation</span>." ".<span>$date</span>." ".<span>$time</span>."以后10列火车信息"<span>; 
                    </span><span>$T</span>[0]['PicUrl']="http://zhengwairen-try2.stor.sinaapp.com/xytq.jpg"<span>; 
                    </span><span>$T</span>[0]['Url']="http://zhengwairen-try2.stor.sinaapp.com/xytq.jpg"<span>;     
                    </span><span>$count</span> = 1<span>;
                    </span><span>foreach</span>(<span>$data</span> <span>as</span> <span>$key</span> =><span>$value</span><span>){
                        </span><span>$str</span>=<span>$count</span>." "<span>;
                        </span><span>$str</span>.="火车列次:{<span>$data</span>[<span>$key</span>]['station_train_code']}\n"<span>;
                        </span><span>$str</span>.="始发站:{<span>$data</span>[<span>$key</span>]['start_station_name']},终点站:{<span>$data</span>[<span>$key</span>]['end_station_name']}\n"<span>;
                        </span><span>$str</span>.="出发时间:{<span>$data</span>[<span>$key</span>]['start_time']},到站时间:{<span>$data</span>[<span>$key</span>]['arrive_time']},历时:{<span>$data</span>[<span>$key</span>]['lishi']}\n"<span>;
                        </span><span>$str</span>.="一等座:{<span>$data</span>[<span>$key</span>]['zy_num']}\n二等座:{<span>$data</span>[<span>$key</span>]['ze_num']}\n硬座:{<span>$data</span>[<span>$key</span>]['yz_num']}\n硬卧:{<span>$data</span>[<span>$key</span>]['yw_num']}\n"<span>;
                         </span><span>$str</span>.="软卧:{<span>$data</span>[<span>$key</span>]['rw_num']}\n软座:{<span>$data</span>[<span>$key</span>]['rz_num']}\n特等座:{<span>$data</span>[<span>$key</span>]['tz_num']}\n无座:{<span>$data</span>[<span>$key</span>]['wz_num']}"<span>;
                        </span><span>$count</span> = <span>$count</span>+1<span>;
                        </span><span>$T</span>[<span>$count</span>]['Title'] = <span>$str</span><span>;
                        </span><span>//</span><span> $T[$count]['Url']="http://kyfw.12306.cn/otn/leftTicket/queryTicketPrice?train_no=".$data[$key]["train_no"]."&from_station_no=".$data[$key]["from_station_no"]."&to_station_no=".$data[$key]["to_station_no"]."&seat_types=".$data[$key]["seat_types"]."&train_date=$date";</span>
                        <span>$T</span>[<span>$count</span>]['Url'] = "https://kyfw.12306.cn/otn/login/init"<span>;
                        </span><span>if</span>(<span>$count</span>==10<span>){
                        </span><span>break</span><span>;}
                    }
                    </span><span>$content</span> =  <span>$T</span><span>;
               }</span><span>else</span>{<span>//</span><span>图灵机器人</span>
                   
                     <span>$file_contents</span> = <span>file_get_contents</span>(<span>$apiURL</span><span>);
                </span><span>$file_contents</span> = json_decode(<span>$file_contents</span>,<span>true</span><span>);
                </span><span>$code</span> = <span>$file_contents</span>["code"<span>];
                </span><span>if</span>(<span>$code</span>==100000<span>){
                    </span><span>$content</span> = <span>$file_contents</span>["text"<span>];
                }</span><span>else</span> <span>if</span>(<span>$code</span>==200000<span>){
                    </span><span>$T</span>[0]['Title']=<span>$file_contents</span>["text"<span>]; 
                    </span><span>//</span><span>$T[0]['PicUrl']="http://zhengwairen-try2.stor.sinaapp.com/xytq.jpg"; </span>
                    <span>$T</span>[0]['Url']=<span>$file_contents</span>["url"<span>];  
                     </span><span>$content</span> = <span>$T</span><span>;
                }</span><span>else</span> <span>if</span>(<span>$code</span>==302000<span>){
                       </span><span>$T</span>[0]['Title']=<span>$file_contents</span>["text"<span>]; 
                    </span><span>$T</span>[0]['PicUrl']="http://zhengwairen-try2.stor.sinaapp.com/xytq.jpg"<span>; 
                    </span><span>$T</span>[0]['Url']="http://zhengwairen-try2.stor.sinaapp.com/xytq.jpg"<span>;  
                    </span><span>$data</span> = <span>$file_contents</span>["list"<span>];
                    </span><span>$count</span> = 1<span>;
                    </span><span>foreach</span>(<span>$data</span> <span>as</span> <span>$key</span> =><span>$value</span><span>){
                            </span><span>$T</span>[<span>$count</span>]['Title']=<span>$data</span>[<span>$key</span>]["article"<span>]; 
                            </span><span>$T</span>[<span>$count</span>]['PicUrl']=<span>$data</span>[<span>$key</span>]["icon"<span>]; 
                            </span><span>$T</span>[<span>$count</span>]['Url']=<span>$data</span>[<span>$key</span>]["detailurl"<span>];  
                            </span><span>$count</span>++<span>;
                    }
                     </span><span>$content</span> = <span>$T</span><span>;
                }</span><span>else</span> <span>if</span>(<span>$code</span>==305000<span>){
                    </span><span>$T</span>[0]['Title']=<span>$file_contents</span>["text"<span>]; 
                    </span><span>$T</span>[0]['PicUrl']="http://zhengwairen-try2.stor.sinaapp.com/xytq.jpg"<span>; 
                    </span><span>$T</span>[0]['Url']="http://zhengwairen-try2.stor.sinaapp.com/xytq.jpg"<span>;  
                    </span><span>$data</span> = <span>$file_contents</span>["list"<span>];
                    </span><span>$count</span> = 1<span>;
                    </span><span>foreach</span>(<span>$data</span> <span>as</span> <span>$key</span> =><span>$value</span><span>){
                            </span><span>$T</span>[<span>$count</span>]['Title']="车次".<span>$data</span>[<span>$key</span>]["trainnum"]."\n起始站:".<span>$data</span>[<span>$key</span>]["start"]."\n到达站:".<span>$data</span>[<span>$key</span>]["terminal"]."\n开车时间:".<span>$data</span>[<span>$key</span>]["starttime"]."\n到达时间:".<span>$data</span>[<span>$key</span>]["endtime"<span>]; 
                            </span><span>$T</span>[<span>$count</span>]['PicUrl']=<span>$data</span>[<span>$key</span>]["icon"<span>]; 
                            </span><span>$T</span>[<span>$count</span>]['Url']=<span>$data</span>[<span>$key</span>]["detailurl"<span>];  
                            </span><span>$count</span>++<span>;
                        </span><span>if</span>(<span>$count</span>==10<span>){
                            </span><span>break</span><span>;
                        }
                    }
                     </span><span>$content</span> = <span>$T</span><span>;
                }</span><span>else</span> <span>if</span>(<span>$code</span>==306000<span>){
                   </span><span>$T</span>[0]['Title']=<span>$file_contents</span>["text"<span>]; 
                    </span><span>$T</span>[0]['PicUrl']="http://zhengwairen-try2.stor.sinaapp.com/xytq.jpg"<span>; 
                    </span><span>$T</span>[0]['Url']="http://zhengwairen-try2.stor.sinaapp.com/xytq.jpg"<span>;  
                    </span><span>$data</span> = <span>$file_contents</span>["list"<span>];
                    </span><span>$count</span> = 1<span>;
                    </span><span>foreach</span>(<span>$data</span> <span>as</span> <span>$key</span> =><span>$value</span><span>){
                        </span><span>$T</span>[<span>$count</span>]['Title']="航班号".<span>$data</span>[<span>$key</span>]["flight"]."航班路线".<span>$data</span>[<span>$key</span>]["route"]."\n起飞时间:".<span>$data</span>[<span>$key</span>]["starttime"]."\n到达时间:".<span>$data</span>[<span>$key</span>]["endtime"]."\n状态:".<span>$data</span>[<span>$key</span>]["state"<span>]; 
                            </span><span>$T</span>[<span>$count</span>]['PicUrl']=<span>$data</span>[<span>$key</span>]["icon"<span>]; 
                            </span><span>$T</span>[<span>$count</span>]['Url']=<span>$data</span>[<span>$key</span>]["detailurl"<span>];  
                            </span><span>$count</span>++<span>;
                    }
                     </span><span>$content</span> = <span>$T</span><span>;
                }</span><span>else</span> <span>if</span>(<span>$code</span>==308000<span>){
                    </span><span>$T</span>[0]['Title']=<span>$file_contents</span>["text"<span>]; 
                    </span><span>$T</span>[0]['PicUrl']="http://zhengwairen-try2.stor.sinaapp.com/xytq.jpg"<span>; 
                    </span><span>$T</span>[0]['Url']="http://zhengwairen-try2.stor.sinaapp.com/xytq.jpg"<span>;  
                    </span><span>$data</span> = <span>$file_contents</span>["list"<span>];
                    </span><span>$count</span> = 1<span>;
                    </span><span>foreach</span>(<span>$data</span> <span>as</span> <span>$key</span> =><span>$value</span><span>){
                        </span><span>$T</span>[<span>$count</span>]['Title']="名称".<span>$data</span>[<span>$key</span>]["name"]."详情".<span>$data</span>[<span>$key</span>]["info"<span>]; 
                            </span><span>$T</span>[<span>$count</span>]['PicUrl']=<span>$data</span>[<span>$key</span>]["icon"<span>]; 
                            </span><span>$T</span>[<span>$count</span>]['Url']=<span>$data</span>[<span>$key</span>]["detailurl"<span>];  
                            </span><span>$count</span>++<span>;
                    }
                     </span><span>$content</span> = <span>$T</span><span>;
                }</span><span>else</span><span>{
                    </span><span>$content</span> = <span>$file_contents</span>["text"<span>];
                }
               }
                
                
              
                
                </span><span>if</span>(<span>is_array</span>(<span>$content</span><span>)){
                    </span><span>if</span> (<span>isset</span>(<span>$content</span>[0]['PicUrl'<span>])){
                           
                        </span><span>$result</span> = <span>$this</span>->transmitNews(<span>$object</span>, <span>$content</span><span>);
                    }</span><span>else</span> <span>if</span> (<span>isset</span>(<span>$content</span>['MusicUrl'<span>])){
                        </span><span>$result</span> = <span>$this</span>->transmitMusic(<span>$object</span>, <span>$content</span><span>);
                    }
                }</span><span>else</span><span>{
                    </span><span>$result</span> = <span>$this</span>->transmitText(<span>$object</span>, <span>$content</span><span>);
                }

            }</span><span>catch</span>(<span>Exception</span> <span>$e</span><span>){
                </span><span>$content</span>=<span>$e</span>-><span>getMessage();
                </span><span>$result</span> = <span>$this</span>->transmitText(<span>$object</span>, <span>$content</span><span>);
            }
            </span><span>return</span> <span>$result</span><span>;
            
        }


        </span><span>//</span><span>接收图片消息</span>
        <span>private</span> <span>function</span> receiveImage(<span>$object</span><span>)
        {
            </span><span>$content</span> = <span>array</span>("MediaId"=><span>$object</span>-><span>MediaId);
            </span><span>$result</span> = <span>$this</span>->transmitImage(<span>$object</span>, <span>$content</span><span>);
            </span><span>return</span> <span>$result</span><span>;
        }

        </span><span>//</span><span>接收位置消息</span>
        <span>private</span> <span>function</span> receiveLocation(<span>$object</span><span>)
        {
            </span><span>$content</span> = "你发送的是位置,纬度为:".<span>$object</span>->Location_X.";经度为:".<span>$object</span>->Location_Y.";缩放级别为:".<span>$object</span>->Scale.";位置为:".<span>$object</span>-><span>Label;
            </span><span>$result</span> = <span>$this</span>->transmitText(<span>$object</span>, <span>$content</span><span>);
            </span><span>return</span> <span>$result</span><span>;
        }

        </span><span>//</span><span>接收语音消息</span>
        <span>private</span> <span>function</span> receiveVoice(<span>$object</span><span>)
        {
            </span><span>if</span> (<span>isset</span>(<span>$object</span>->Recognition) && !<span>empty</span>(<span>$object</span>-><span>Recognition)){
                </span><span>$content</span> = "你刚才说的是:".<span>$object</span>-><span>Recognition;
                </span><span>$result</span> = <span>$this</span>->transmitText(<span>$object</span>, <span>$content</span><span>);
            }</span><span>else</span><span>{
                </span><span>$content</span> = <span>array</span>("MediaId"=><span>$object</span>-><span>MediaId);
                </span><span>$result</span> = <span>$this</span>->transmitVoice(<span>$object</span>, <span>$content</span><span>);
            }

            </span><span>return</span> <span>$result</span><span>;
        }

        </span><span>//</span><span>接收视频消息</span>
        <span>private</span> <span>function</span> receiveVideo(<span>$object</span><span>)
        {
            </span><span>$content</span> = <span>array</span>("MediaId"=><span>$object</span>->MediaId, "ThumbMediaId"=><span>$object</span>->ThumbMediaId, "Title"=>"", "Description"=>""<span>);
            </span><span>$result</span> = <span>$this</span>->transmitVideo(<span>$object</span>, <span>$content</span><span>);
            </span><span>return</span> <span>$result</span><span>;
        }

        </span><span>//</span><span>接收链接消息</span>
        <span>private</span> <span>function</span> receiveLink(<span>$object</span><span>)
        {
            </span><span>$content</span> = "你发送的是链接,标题为:".<span>$object</span>->Title.";内容为:".<span>$object</span>->Description.";链接地址为:".<span>$object</span>-><span>Url;
            </span><span>$result</span> = <span>$this</span>->transmitText(<span>$object</span>, <span>$content</span><span>);
            </span><span>return</span> <span>$result</span><span>;
        }

        </span><span>//</span><span>回复文本消息</span>
        <span>private</span> <span>function</span> transmitText(<span>$object</span>, <span>$content</span><span>)
        {
            </span><span>$xmlTpl</span> = "<span><xml>
    <tousername></tousername>
    <fromusername></fromusername>
    <createtime>%s</createtime>
    <msgtype></msgtype>
    <content></content>
    </xml></span>"<span>;
            </span><span>$result</span> = <span>sprintf</span>(<span>$xmlTpl</span>, <span>$object</span>->FromUserName, <span>$object</span>->ToUserName, <span>time</span>(), <span>$content</span><span>);
            </span><span>return</span> <span>$result</span><span>;
        }

        </span><span>//</span><span>回复图片消息</span>
        <span>private</span> <span>function</span> transmitImage(<span>$object</span>, <span>$imageArray</span><span>)
        {
            </span><span>$itemTpl</span> = "<span><image>
        <mediaid></mediaid>
    </image></span>"<span>;

            </span><span>$item_str</span> = <span>sprintf</span>(<span>$itemTpl</span>, <span>$imageArray</span>['MediaId'<span>]);

            </span><span>$xmlTpl</span> = "<span><xml>
    <tousername></tousername>
    <fromusername></fromusername>
    <createtime>%s</createtime>
    <msgtype></msgtype>
    </xml></span><span>$item_str</span><span>
    </span>"<span>;

            </span><span>$result</span> = <span>sprintf</span>(<span>$xmlTpl</span>, <span>$object</span>->FromUserName, <span>$object</span>->ToUserName, <span>time</span><span>());
            </span><span>return</span> <span>$result</span><span>;
        }

        </span><span>//</span><span>回复语音消息</span>
        <span>private</span> <span>function</span> transmitVoice(<span>$object</span>, <span>$voiceArray</span><span>)
        {
            </span><span>$itemTpl</span> = "<span><voice>
        <mediaid></mediaid>
    </voice></span>"<span>;

            </span><span>$item_str</span> = <span>sprintf</span>(<span>$itemTpl</span>, <span>$voiceArray</span>['MediaId'<span>]);

            </span><span>$xmlTpl</span> = "<span><xml>
    <tousername></tousername>
    <fromusername></fromusername>
    <createtime>%s</createtime>
    <msgtype></msgtype>
    </xml></span><span>$item_str</span><span>
    </span>"<span>;

            </span><span>$result</span> = <span>sprintf</span>(<span>$xmlTpl</span>, <span>$object</span>->FromUserName, <span>$object</span>->ToUserName, <span>time</span><span>());
            </span><span>return</span> <span>$result</span><span>;
        }

        </span><span>//</span><span>回复视频消息</span>
        <span>private</span> <span>function</span> transmitVideo(<span>$object</span>, <span>$videoArray</span><span>)
        {
            </span><span>$itemTpl</span> = "<span><video>
        <mediaid></mediaid>
        <thumbmediaid></thumbmediaid>
        <title></title>
        <description></description>
    </video></span>"<span>;

            </span><span>$item_str</span> = <span>sprintf</span>(<span>$itemTpl</span>, <span>$videoArray</span>['MediaId'], <span>$videoArray</span>['ThumbMediaId'], <span>$videoArray</span>['Title'], <span>$videoArray</span>['Description'<span>]);

            </span><span>$xmlTpl</span> = "<span><xml>
    <tousername></tousername>
    <fromusername></fromusername>
    <createtime>%s</createtime>
    <msgtype></msgtype>
    </xml></span><span>$item_str</span><span>
    </span>"<span>;

            </span><span>$result</span> = <span>sprintf</span>(<span>$xmlTpl</span>, <span>$object</span>->FromUserName, <span>$object</span>->ToUserName, <span>time</span><span>());
            </span><span>return</span> <span>$result</span><span>;
        }

        </span><span>//</span><span>回复图文消息</span>
        <span>private</span> <span>function</span> transmitNews(<span>$object</span>, <span>$newsArray</span><span>)
        {
            </span><span>if</span>(!<span>is_array</span>(<span>$newsArray</span><span>)){
                </span><span>return</span><span>;
            }
            </span><span>$itemTpl</span> = "<span>    <item>
            <title></title>
            <description></description>
            <picurl></picurl>
            <url></url>
        </item>
    </span>"<span>;
            </span><span>$item_str</span> = ""<span>;
            </span><span>foreach</span> (<span>$newsArray</span> <span>as</span> <span>$item</span><span>){
                </span><span>$item_str</span> .= <span>sprintf</span>(<span>$itemTpl</span>, <span>$item</span>['Title'], <span>$item</span>['Description'], <span>$item</span>['PicUrl'], <span>$item</span>['Url'<span>]);
            }
            </span><span>$xmlTpl</span> = "<span><xml>
    <tousername></tousername>
    <fromusername></fromusername>
    <createtime>%s</createtime>
    <msgtype></msgtype>
    <articlecount>%s</articlecount>
    <articles>
    </articles></xml></span><span>$item_str</span><span>
    </span>"<span>;

            </span><span>$result</span> = <span>sprintf</span>(<span>$xmlTpl</span>, <span>$object</span>->FromUserName, <span>$object</span>->ToUserName, <span>time</span>(), <span>count</span>(<span>$newsArray</span><span>));
            </span><span>return</span> <span>$result</span><span>;
        }

        </span><span>//</span><span>回复音乐消息</span>
        <span>private</span> <span>function</span> transmitMusic(<span>$object</span>, <span>$musicArray</span><span>)
        {
            </span><span>$itemTpl</span> = "<span><music>
        <title></title>
        <description></description>
        <musicurl></musicurl>
        <hqmusicurl></hqmusicurl>
    </music></span>"<span>;

            </span><span>$item_str</span> = <span>sprintf</span>(<span>$itemTpl</span>, <span>$musicArray</span>['Title'], <span>$musicArray</span>['Description'], <span>$musicArray</span>['MusicUrl'], <span>$musicArray</span>['HQMusicUrl'<span>]);

            </span><span>$xmlTpl</span> = "<span><xml>
    <tousername></tousername>
    <fromusername></fromusername>
    <createtime>%s</createtime>
    <msgtype></msgtype>
    </xml></span><span>$item_str</span><span>
    </span>"<span>;

            </span><span>$result</span> = <span>sprintf</span>(<span>$xmlTpl</span>, <span>$object</span>->FromUserName, <span>$object</span>->ToUserName, <span>time</span><span>());
            </span><span>return</span> <span>$result</span><span>;
        }

        </span><span>//</span><span>回复多客服消息</span>
        <span>private</span> <span>function</span> transmitService(<span>$object</span><span>)
        {
            </span><span>$xmlTpl</span> = "<span><xml>
    <tousername></tousername>
    <fromusername></fromusername>
    <createtime>%s</createtime>
    <msgtype></msgtype>
    </xml></span>"<span>;
            </span><span>$result</span> = <span>sprintf</span>(<span>$xmlTpl</span>, <span>$object</span>->FromUserName, <span>$object</span>->ToUserName, <span>time</span><span>());
            </span><span>return</span> <span>$result</span><span>;
        }

        </span><span>//</span><span>日志记录</span>
        <span>private</span> <span>function</span> logger(<span>$log_content</span><span>)
        {
            </span><span>if</span>(<span>isset</span>(<span>$_SERVER</span>['HTTP_APPNAME'])){   <span>//</span><span>SAE</span>
                sae_set_display_errors(<span>false</span><span>);
                sae_debug(</span><span>$log_content</span><span>);
                sae_set_display_errors(</span><span>true</span><span>);
            }</span><span>else</span> <span>if</span>(<span>$_SERVER</span>['REMOTE_ADDR'] != "127.0.0.1"){ <span>//</span><span>LOCAL</span>
                <span>$max_size</span> = 10000<span>;
                </span><span>$log_filename</span> = "log.xml"<span>;
                </span><span>if</span>(<span>file_exists</span>(<span>$log_filename</span>) and (<span>abs</span>(<span>filesize</span>(<span>$log_filename</span>)) > <span>$max_size</span>)){<span>unlink</span>(<span>$log_filename</span><span>);}
                </span><span>file_put_contents</span>(<span>$log_filename</span>, <span>date</span>('H:i:s')." ".<span>$log_content</span>."\r\n",<span> FILE_APPEND);
            }
        }
    }
    </span>?>
Salin selepas log masuk
View Code

<span>php
</span><span>return</span> <span>array</span><span>(
        </span>"北京北" => "VAP",
        "北京东" => "BOP",
        "北京" => "BJP",
        "北京南" => "VNP",
        "北京西" => "BXP",
        "重庆北" => "CUW",
        "重庆" => "CQW",
        "重庆南" => "CRW",
        "长春" => "CCT",
        "长春南" => "CET",
        "长春西" => "CRT",
        "成都东" => "ICW",
        "成都南" => "CNW",
        "成都" => "CDW",
        "长沙" => "CSQ",
        "长沙南" => "CWQ",
        "阿尔山" => "ART",
        "安康" => "AKY",
        "阿克苏" => "ASR",
        "阿里河" => "AHX",
        "阿拉山口" => "AKR",
        "安平" => "APT",
        "安庆" => "AQH",
        "安顺" => "ASW",
        "鞍山" => "AST",
        "安阳" => "AYF",
        "北安" => "BAB",
        "蚌埠" => "BBH",
        "白城" => "BCT",
        "北海" => "BHZ",
        "白河" => "BEL",
        "白涧" => "BAP",
        "宝鸡" => "BJY",
        "滨江" => "BJB",
        "博克图" => "BKX",
        "百色" => "BIZ",
        "白山市" => "HJL",
        "北台" => "BTT",
        "包头东" => "BDC",
        "包头" => "BTC",
        "北屯市" => "BXR",
        "本溪" => "BXT",
        "白云鄂博" => "BEC",
        "白银西" => "BXJ",
        "亳州" => "BZH",
        "赤壁" => "CBN",
        "常德" => "VGQ",
        "承德" => "CDP",
        "长甸" => "CDT",
        "赤峰" => "CFD",
        "茶陵" => "CDG",
        "苍南" => "CEH",
        "昌平" => "CPP",
        "崇仁" => "CRG",
        "昌图" => "CTT",
        "长汀镇" => "CDB",
        "崇信" => "CIJ",
        "曹县" => "CXK",
        "楚雄" => "COM",
        "陈相屯" => "CXT",
        "长治北" => "CBF",
        "长征" => "CZJ",
        "池州" => "IYH",
        "常州" => "CZH",
        "郴州" => "CZQ",
        "长治" => "CZF",
        "沧州" => "COP",
        "崇左" => "CZZ",
        "大安北" => "RNT",
        "大成" => "DCT",
        "丹东" => "DUT",
        "东方红" => "DFB",
        "东莞东" => "DMQ",
        "大虎山" => "DHD",
        "敦煌" => "DHJ",
        "敦化" => "DHL",
        "德惠" => "DHT",
        "东京城" => "DJB",
        "大涧" => "DFP",
        "都江堰" => "DDW",
        "大连北" => "DFT",
        "大理" => "DKM",
        "大连" => "DLT",
        "定南" => "DNG",
        "大庆" => "DZX",
        "东胜" => "DOC",
        "大石桥" => "DQT",
        "大同" => "DTV",
        "东营" => "DPK",
        "大杨树" => "DUX",
        "都匀" => "RYW",
        "邓州" => "DOF",
        "达州" => "RXW",
        "德州" => "DZP",
        "额济纳" => "EJC",
        "二连" => "RLC",
        "恩施" => "ESN",
        "昂昂溪" => "AAX",
        "阿城" => "ACB",
        "安达" => "ADX",
        "安定" => "ADP",
        "安广" => "AGT",
        "艾河" => "AHP",
        "安化" => "PKQ",
        "艾家村" => "AJJ",
        "鳌江" => "ARH",
        "安家" => "AJB",
        "阿金" => "AJD",
        "阿克陶" => "AER",
        "安口窑" => "AYY",
        "敖力布告" => "ALD",
        "安龙" => "AUZ",
        "阿龙山" => "ASX",
        "安陆" => "ALN",
        "阿木尔" => "JTX",
        "阿南庄" => "AZM",
        "安庆西" => "APH",
        "鞍山西" => "AXT",
        "安塘" => "ATV",
        "安亭北" => "ASH",
        "阿图什" => "ATR",
        "安图" => "ATL",
        "安溪" => "AXS",
        "博鳌" => "BWQ",
        "白壁关" => "BGV",
        "蚌埠南" => "BMH",
        "巴楚" => "BCR",
        "板城" => "BUP",
        "北戴河" => "BEP",
        "保定" => "BDP",
        "宝坻" => "BPP",
        "八达岭" => "ILP",
        "巴东" => "BNN",
        "柏果" => "BGM",
        "布海" => "BUT",
        "白河东" => "BIY",
        "贲红" => "BVC",
        "宝华山" => "BWH",
        "白河县" => "BEY",
        "白芨沟" => "BJJ",
        "碧鸡关" => "BJM",
        "北滘" => "IBQ",
        "碧江" => "BLQ",
        "白鸡坡" => "BBM",
        "笔架山" => "BSB",
        "八角台" => "BTD",
        "保康" => "BKD",
        "白奎堡" => "BKB",
        "白狼" => "BAT",
        "百浪" => "BRZ",
        "博乐" => "BOR",
        "宝拉格" => "BQC",
        "巴林" => "BLX",
        "宝林" => "BNB",
        "北流" => "BOZ",
        "勃利" => "BLB",
        "布列开" => "BLR",
        "宝龙山" => "BND",
        "八面城" => "BMD",
        "班猫箐" => "BNM",
        "八面通" => "BMB",
        "北马圈子" => "BRP",
        "北票南" => "RPD",
        "白旗" => "BQP",
        "宝泉岭" => "BQB",
        "白泉" => "BQL",
        "白沙" => "BSW",
        "巴山" => "BAY",
        "白水江" => "BSY",
        "白沙坡" => "BPM",
        "白石山" => "BAL",
        "白水镇" => "BUM",
        "坂田" => "BTQ",
        "泊头" => "BZP",
        "北屯" => "BYP",
        "本溪湖" => "BHT",
        "博兴" => "BXK",
        "八仙筒" => "VXD",
        "白音察干" => "BYC",
        "背荫河" => "BYB",
        "北营" => "BIV",
        "巴彦高勒" => "BAC",
        "白音他拉" => "BID",
        "鲅鱼圈" => "BYT",
        "白银市" => "BNJ",
        "白音胡硕" => "BCD",
        "巴中" => "IEW",
        "霸州" => "RMP",
        "北宅" => "BVP",
        "赤壁北" => "CIN",
        "查布嘎" => "CBC",
        "长城" => "CEJ",
        "长冲" => "CCM",
        "承德东" => "CCP",
        "赤峰西" => "CID",
        "嵯岗" => "CAX",
        "柴岗" => "CGT",
        "长葛" => "CEF",
        "柴沟堡" => "CGV",
        "城固" => "CGY",
        "陈官营" => "CAJ",
        "成高子" => "CZB",
        "草海" => "WBW",
        "柴河" => "CHB",
        "册亨" => "CHZ",
        "草河口" => "CKT",
        "崔黄口" => "CHP",
        "巢湖" => "CIH",
        "蔡家沟" => "CJT",
        "成吉思汗" => "CJX",
        "岔江" => "CAM",
        "蔡家坡" => "CJY",
        "沧口" => "CKK",
        "昌乐" => "CLK",
        "超梁沟" => "CYP",
        "慈利" => "CUQ",
        "昌黎" => "CLP",
        "长岭子" => "CLT",
        "晨明" => "CMB",
        "长农" => "CNJ",
        "昌平北" => "VBP",
        "长坡岭" => "CPM",
        "辰清" => "CQB",
        "楚山" => "CSB",
        "长寿" => "EFW",
        "磁山" => "CSP",
        "苍石" => "CST",
        "草市" => "CSL",
        "察素齐" => "CSC",
        "长山屯" => "CVT",
        "长汀" => "CES",
        "昌图西" => "CPT",
        "春湾" => "CQQ",
        "磁县" => "CIP",
        "岑溪" => "CNZ",
        "辰溪" => "CXQ",
        "磁西" => "CRP",
        "长兴南" => "CFH",
        "磁窑" => "CYK",
        "朝阳" => "CYD",
        "春阳" => "CAL",
        "城阳" => "CEK",
        "创业村" => "CEX",
        "朝阳川" => "CYL",
        "朝阳地" => "CDD",
        "长垣" => "CYF",
        "朝阳镇" => "CZL",
        "滁州北" => "CUH",
        "常州北" => "ESH",
        "滁州" => "CXH",
        "潮州" => "CKQ",
        "常庄" => "CVK",
        "曹子里" => "CFP",
        "车转湾" => "CWM",
        "郴州西" => "ICQ",
        "沧州西" => "CBP",
        "德安" => "DAG",
        "大安" => "RAT",
        "东安" => "DAZ",
        "大坝" => "DBJ",
        "大板" => "DBC",
        "大巴" => "DBD",
        "到保" => "RBT",
        "定边" => "DYJ",
        "东边井" => "DBB",
        "德伯斯" => "RDT",
        "打柴沟" => "DGJ",
        "德昌" => "DVW",
        "滴道" => "DDB",
        "大德" => "DEM",
        "大磴沟" => "DKJ",
        "刀尔登" => "DRD",
        "得耳布尔" => "DRX",
        "东方" => "UFQ",
        "丹凤" => "DGY",
        "东丰" => "DIL",
        "都格" => "DMM",
        "大官屯" => "DTT",
        "大关" => "RGW",
        "东光" => "DGP",
        "东莞" => "DAQ",
        "东海" => "DHB",
        "大灰厂" => "DHP",
        "大红旗" => "DQD",
        "东海县" => "DQH",
        "德惠西" => "DXT",
        "达家沟" => "DJT",
        "东津" => "DKB",
        "杜家" => "DJL",
        "大旧庄" => "DJM",
        "大口屯" => "DKP",
        "东来" => "RVD",
        "德令哈" => "DHO",
        "大陆号" => "DLC",
        "带岭" => "DLB",
        "大林" => "DLD",
        "达拉特旗" => "DIC",
        "独立屯" => "DTX",
        "豆罗" => "DLV",
        "达拉特西" => "DNC",
        "东明村" => "DMD",
        "洞庙河" => "DEP",
        "东明县" => "DNF",
        "大拟" => "DNZ",
        "大平房" => "DPD",
        "大盘石" => "RPP",
        "大埔" => "DPI",
        "大堡" => "DVT",
        "大其拉哈" => "DQX",
        "道清" => "DML",
        "对青山" => "DQB",
        "德清西" => "MOH",
        "东升" => "DRQ",
        "独山" => "RWW",
        "砀山" => "DKH",
        "登沙河" => "DWT",
        "读书铺" => "DPM",
        "大石头" => "DSL",
        "大石寨" => "RZT",
        "东台" => "DBH",
        "定陶" => "DQK",
        "灯塔" => "DGT",
        "大田边" => "DBM",
        "东通化" => "DTL",
        "丹徒" => "RUH",
        "大屯" => "DNT",
        "东湾" => "DRJ",
        "大武口" => "DFJ",
        "低窝铺" => "DWJ",
        "大王滩" => "DZZ",
        "大湾子" => "DFM",
        "大兴沟" => "DXL",
        "大兴" => "DXX",
        "定西" => "DSJ",
        "甸心" => "DXM",
        "东乡" => "DXG",
        "代县" => "DKV",
        "定襄" => "DXV",
        "东戌" => "RXP",
        "东辛庄" => "DXD",
        "丹阳" => "DYH",
        "大雁" => "DYX",
        "德阳" => "DYW",
        "当阳" => "DYN",
        "丹阳北" => "EXH",
        "大英东" => "IAW",
        "东淤地" => "DBV",
        "大营" => "DYV",
        "定远" => "EWH",
        "岱岳" => "RYV",
        "大元" => "DYZ",
        "大营镇" => "DJP",
        "大营子" => "DZD",
        "大战场" => "DTJ",
        "德州东" => "DIP",
        "低庄" => "DVQ",
        "东镇" => "DNV",
        "道州" => "DFZ",
        "东至" => "DCH",
        "东庄" => "DZV",
        "兑镇" => "DWV",
        "豆庄" => "ROP",
        "定州" => "DXP",
        "大竹园" => "DZY",
        "大杖子" => "DAP",
        "豆张庄" => "RZP",
        "峨边" => "EBW",
        "二道沟门" => "RDP",
        "二道湾" => "RDX",
        "二龙" => "RLD",
        "二龙山屯" => "ELA",
        "峨眉" => "EMW",
        "二密河" => "RML",
        "二营" => "RYJ",
        "鄂州" => "ECN",
        "安阳东" => "ADF",
        "保定东" => "BMP",
        "长阳" => "CYN",
        "东二道河" => "DRB",
        "大苴" => "DIM",
        "大青沟" => "DSD",
        "定州东" => "DOP",
        "福州" => "FZS",
        "福州南" => "FYS",
        "贵阳" => "GIW",
        "广州北" => "GBQ",
        "广州东" => "GGQ",
        "广州" => "GZQ",
        "广州南" => "IZQ",
        "哈尔滨" => "HBB",
        "哈尔滨东" => "VBB",
        "哈尔滨西" => "VAB",
        "合肥" => "HFH",
        "合肥西" => "HTH",
        "呼和浩特东" => "NDC",
        "呼和浩特" => "HHC",
        "海口东" => "HMQ",
        "海口" => "VUQ",
        "杭州" => "HZH",
        "杭州南" => "XHH",
        "济南" => "JNK",
        "济南东" => "JAK",
        "济南西" => "JGK",
        "防城港" => "FEZ",
        "福鼎" => "FES",
        "风陵渡" => "FLV",
        "涪陵" => "FLW",
        "富拉尔基" => "FRX",
        "抚顺北" => "FET",
        "佛山" => "FSQ",
        "阜新" => "FXD",
        "阜阳" => "FYH",
        "格尔木" => "GRO",
        "广汉" => "GHW",
        "古交" => "GJV",
        "桂林北" => "GBZ",
        "古莲" => "GRX",
        "桂林" => "GLZ",
        "固始" => "GXN",
        "广水" => "GSN",
        "干塘" => "GNJ",
        "广元" => "GYW",
        "赣州" => "GZG",
        "公主岭" => "GLT",
        "公主岭南" => "GBT",
        "淮安" => "AUH",
        "鹤北" => "HMB",
        "淮北" => "HRH",
        "淮滨" => "HVN",
        "河边" => "HBV",
        "潢川" => "KCN",
        "韩城" => "HCY",
        "邯郸" => "HDP",
        "横道河子" => "HDB",
        "鹤岗" => "HGB",
        "皇姑屯" => "HTT",
        "红果" => "HEM",
        "黑河" => "HJB",
        "怀化" => "HHQ",
        "汉口" => "HKN",
        "葫芦岛" => "HLD",
        "海拉尔" => "HRX",
        "霍林郭勒" => "HWD",
        "海伦" => "HLB",
        "侯马" => "HMV",
        "哈密" => "HMR",
        "淮南" => "HAH",
        "桦南" => "HNB",
        "海宁西" => "EUH",
        "鹤庆" => "HQM",
        "怀柔北" => "HBP",
        "怀柔" => "HRP",
        "黄石东" => "OSN",
        "华山" => "HSY",
        "黄石" => "HSN",
        "黄山" => "HKH",
        "衡水" => "HSP",
        "衡阳" => "HYQ",
        "菏泽" => "HIK",
        "贺州" => "HXZ",
        "汉中" => "HOY",
        "惠州" => "HCQ",
        "吉安" => "VAG",
        "集安" => "JAL",
        "江边村" => "JBG",
        "晋城" => "JCF",
        "金城江" => "JJZ",
        "景德镇" => "JCG",
        "嘉峰" => "JFF",
        "加格达奇" => "JGX",
        "井冈山" => "JGG",
        "蛟河" => "JHL",
        "金华南" => "RNH",
        "金华西" => "JBH",
        "九江" => "JJG",
        "吉林" => "JLL",
        "荆门" => "JMN",
        "佳木斯" => "JMB",
        "济宁" => "JIK",
        "集宁南" => "JAC",
        "酒泉" => "JQJ",
        "江山" => "JUH",
        "吉首" => "JIQ",
        "九台" => "JTL",
        "镜铁山" => "JVJ",
        "鸡西" => "JXB",
        "蓟县" => "JKP",
        "绩溪县" => "JRH",
        "嘉峪关" => "JGJ",
        "江油" => "JFW",
        "锦州" => "JZD",
        "金州" => "JZT",
        "福安" => "FAS",
        "防城" => "FAZ",
        "丰城" => "FCG",
        "丰城南" => "FNG",
        "肥东" => "FIH",
        "发耳" => "FEM",
        "富海" => "FHX",
        "福海" => "FHR",
        "凤凰城" => "FHT",
        "奉化" => "FHH",
        "富锦" => "FIB",
        "范家屯" => "FTT",
        "福利屯" => "FTB",
        "丰乐镇" => "FZB",
        "阜南" => "FNH",
        "阜宁" => "AKH",
        "抚宁" => "FNP",
        "福清" => "FQS",
        "福泉" => "VMW",
        "丰水村" => "FSJ",
        "丰顺" => "FUQ",
        "繁峙" => "FSV",
        "抚顺" => "FST",
        "福山口" => "FKP",
        "扶绥" => "FSZ",
        "冯屯" => "FTX",
        "浮图峪" => "FYP",
        "富县东" => "FDY",
        "凤县" => "FXY",
        "富县" => "FEY",
        "费县" => "FXK",
        "凤阳" => "FUH",
        "汾阳" => "FAV",
        "扶余北" => "FBT",
        "分宜" => "FYG",
        "富源" => "FYM",
        "扶余" => "FYT",
        "富裕" => "FYX",
        "抚州北" => "FBG",
        "凤州" => "FZY",
        "丰镇" => "FZC",
        "范镇" => "VZK",
        "固安" => "GFP",
        "广安" => "VJW",
        "高碑店" => "GBP",
        "沟帮子" => "GBD",
        "甘草店" => "GDJ",
        "谷城" => "GCN",
        "藁城" => "GEP",
        "高村" => "GCV",
        "古城镇" => "GZB",
        "广德" => "GRH",
        "贵定" => "GTW",
        "贵定南" => "IDW",
        "古东" => "GDV",
        "贵港" => "GGZ",
        "官高" => "GVP",
        "葛根庙" => "GGT",
        "干沟" => "GGL",
        "甘谷" => "GGJ",
        "高各庄" => "GGP",
        "甘河" => "GAX",
        "根河" => "GEX",
        "郭家店" => "GDT",
        "孤家子" => "GKT",
        "高老" => "GOB",
        "古浪" => "GLJ",
        "皋兰" => "GEJ",
        "高楼房" => "GFM",
        "归流河" => "GHT",
        "关林" => "GLF",
        "甘洛" => "VOW",
        "郭磊庄" => "GLP",
        "高密" => "GMK",
        "公庙子" => "GMC",
        "工农湖" => "GRT",
        "广宁寺" => "GNT",
        "广南卫" => "GNM",
        "高平" => "GPF",
        "甘泉北" => "GEY",
        "共青城" => "GAG",
        "甘旗卡" => "GQD",
        "甘泉" => "GQY",
        "高桥镇" => "GZD",
        "赶水" => "GSW",
        "灌水" => "GST",
        "孤山口" => "GSP",
        "果松" => "GSL",
        "高山子" => "GSD",
        "嘎什甸子" => "GXD",
        "高台" => "GTJ",
        "高滩" => "GAY",
        "古田" => "GTS",
        "官厅" => "GTP",
        "广通" => "GOM",
        "官厅西" => "KEP",
        "贵溪" => "GXG",
        "涡阳" => "GYH",
        "巩义" => "GXF",
        "高邑" => "GIP",
        "巩义南" => "GYF",
        "固原" => "GUJ",
        "菇园" => "GYL",
        "公营子" => "GYD",
        "光泽" => "GZS",
        "古镇" => "GNQ",
        "瓜州" => "GZJ",
        "高州" => "GSQ",
        "固镇" => "GEH",
        "盖州" => "GXT",
        "官字井" => "GOT",
        "革镇堡" => "GZT",
        "冠豸山" => "GSS",
        "盖州西" => "GAT",
        "红安" => "HWN",
        "淮安南" => "AMH",
        "红安西" => "VXN",
        "海安县" => "HIH",
        "黄柏" => "HBL",
        "海北" => "HEB",
        "鹤壁" => "HAF",
        "华城" => "VCQ",
        "合川" => "WKW",
        "河唇" => "HCZ",
        "汉川" => "HCN",
        "海城" => "HCT",
        "黑冲滩" => "HCJ",
        "黄村" => "HCP",
        "海城西" => "HXT",
        "化德" => "HGC",
        "洪洞" => "HDV",
        "横峰" => "HFG",
        "韩府湾" => "HXJ",
        "汉沽" => "HGP",
        "黄瓜园" => "HYM",
        "红光镇" => "IGW",
        "浑河" => "HHT",
        "红花沟" => "VHD",
        "黄花筒" => "HUD",
        "贺家店" => "HJJ",
        "和静" => "HJR",
        "红江" => "HFM",
        "黑井" => "HIM",
        "获嘉" => "HJF",
        "河津" => "HJV",
        "涵江" => "HJS",
        "华家" => "HJT",
        "河间西" => "HXP",
        "花家庄" => "HJM",
        "河口南" => "HKJ",
        "黄口" => "KOH",
        "湖口" => "HKG",
        "呼兰" => "HUB",
        "葫芦岛北" => "HPD",
        "浩良河" => "HHB",
        "哈拉海" => "HIT",
        "鹤立" => "HOB",
        "桦林" =&
Salin selepas log masuk
Label berkaitan:
sumber:php.cn
Kenyataan Laman Web ini
Kandungan artikel ini disumbangkan secara sukarela oleh netizen, dan hak cipta adalah milik pengarang asal. Laman web ini tidak memikul tanggungjawab undang-undang yang sepadan. Jika anda menemui sebarang kandungan yang disyaki plagiarisme atau pelanggaran, sila hubungi admin@php.cn
Tutorial Popular
Lagi>
Muat turun terkini
Lagi>
kesan web
Kod sumber laman web
Bahan laman web
Templat hujung hadapan