自己收集整理的程式碼,簡單的實現天氣及QQ線上查詢。僅供參考,歡迎拍磚。
-
/*Generate at Sun, 04 Jan 2009 13:46:27 +0000
- Don't Modify Me!
- Cache Name Citys
- key:a5819c80f61198eabf3d3ffceec595de
- */
- $Citys=array (
- 54511 => '北京 ',
- 58367 => '上海 ',
- 54517 => '天津 ',
- 57516 => '重庆 ',
- 45005 => '香港 ',
- 45011 => '澳门 ',
- 50953 => '哈尔滨 ',
- 50745 => '齐齐哈尔 ',
- 54094 => '牡丹江 ',
- 50842 => '大庆 ',
- 50774 => '伊春 ',
- 50884 => '双鸭山 ',
- 50775 => '鹤岗 ',
- 50978 => '鸡西 ',
- 50873 => '佳木斯 ',
- 50971 => '七台河 ',
- 50468 => '黑河 ',
- 50853 => '绥化 ',
- 50442 => '大兴安岭 ',
- 54161 => '长春 ',
- 54172 => '吉林 ',
- 54371 => '白山 ',
- 50936 => '白城 ',
- 54157 => '四平 ',
- 50946 => '松原 ',
- 54260 => '辽源 ',
- 50945 => '大安 ',
- 54363 => '通化 ',
- 54342 => '沈阳 ',
- 54662 => '大连 ',
- 54453 => '葫芦岛 ',
- 54660 => '旅顺 ',
- 54346 => '本溪 ',
- 54353 => '抚顺 ',
- 54249 => '铁岭 ',
- 54347 => '辽阳 ',
- 54471 => '营口 ',
- 54237 => '阜新 ',
- 54324 => '朝阳 ',
- 54337 => '锦州 ',
- 54497 => '丹东 ',
- 54339 => '鞍山 ',
- 53463 => '呼和浩特 ',
- 54102 => '锡林浩特 ',
- 53446 => '包头 ',
- 54218 => '赤峰 ',
- 50527 => '海拉尔 ',
- 53512 => '乌海 ',
- 53543 => '鄂尔多斯 ',
- 54135 => '通辽 ',
- 53698 => '石家庄 ',
- 54534 => '唐山 ',
- 54401 => '张家口 ',
- 54515 => '廊坊 ',
- 53798 => '邢台 ',
- 53892 => '邯郸 ',
- 54616 => '沧州 ',
- 54702 => '衡水 ',
- 54423 => '承德 ',
- 54602 => '保定 ',
- 54449 => '秦皇岛 ',
- 57083 => '郑州 ',
- 57091 => '开封 ',
- 57073 => '洛阳 ',
- 57171 => '平顶山 ',
- 53982 => '焦作 ',
- 53990 => '鹤壁 ',
- 53986 => '新乡 ',
- 53898 => '安阳 ',
- 54900 => '濮阳 ',
- 57089 => '许昌 ',
- 57186 => '漯河 ',
- 57051 => '三门峡 ',
- 57178 => '南阳 ',
- 58005 => '商丘 ',
- 57297 => '信阳 ',
- 57195 => '周口 ',
- 57290 => '驻马店 ',
- 54823 => '济南 ',
- 54857 => '青岛 ',
- 54830 => '淄博 ',
- 54774 => '威海 ',
- 54918 => '曲阜 ',
- 54938 => '临沂 ',
- 54765 => '烟台 ',
- 58024 => '枣庄 ',
- 54806 => '聊城 ',
- 54915 => '济宁 ',
- 54906 => '菏泽 ',
- 54827 => '泰安 ',
- 54945 => '日照 ',
- 54736 => '东营 ',
- 54714 => '德州 ',
- 54734 => '滨州 ',
- 54828 => '莱芜 ',
- 54843 => '潍坊 ',
- 53772 => '太原 ',
- 53782 => '阳泉 ',
- 53976 => '晋城 ',
- 53778 => '晋中 ',
- 53868 => '临汾 ',
- 53959 => '运城 ',
- 53882 => '长治 ',
- 53578 => '朔州 ',
- 53674 => '忻州 ',
- 53487 => '大同 ',
- 58238 => '南京 ',
- 58357 => '苏州 ',
- 58356 => '昆山 ',
- 58259 => '南通 ',
- 58377 => '太仓 ',
- 58349 => '吴县 ',
- 58027 => '徐州 ',
- 58346 => '宜兴 ',
- 58248 => '镇江 ',
- 58145 => '淮安 ',
- 58352 => '常熟 ',
- 58151 => '盐城 ',
- 58246 => '泰州 ',
- 58354 => '无锡 ',
- 58044 => '连云港 ',
- 58245 => '扬州 ',
- 58343 => '常州 ',
- 58131 => '宿迁 ',
- 58321 => '合肥 ',
- 58326 => '巢湖 ',
- 58221 => '蚌埠 ',
- 58424 => '安庆 ',
- 58311 => '六安 ',
- 58236 => '滁州 ',
- 58336 => '马鞍山 ',
- 58203 => '阜阳 ',
- 58433 => '宣城 ',
- 58429 => '铜陵 ',
- 58116 => '淮北 ',
- 58334 => '芜湖 ',
- 58122 => '宿州 ',
- 58224 => '淮南 ',
- 58427 => '池州 ',
- 57036 => '西安 ',
- 53955 => '韩城 ',
- 57245 => '安康 ',
- 57127 => '汉中 ',
- 57016 => '寶雞',
- 57048 => '鹹陽',
- 53646 => '榆林',
- 57045 => '渭南',
- 57143 = '商53947 => '銅川',
- 53845 => '延安',
- 53614 => '銀川',
- 53817 => '固原',
- 53704 => '中衛',
- '中衛',
- '中衛',
- '中衛',
- '中衛',
- '中衛',
- '中衛',
- '中衛',
- '中衛',
- '中衛',
- 53518 => '石嘴山',
- 53612 => '吳忠',
- 52889 => '蘭州',
- 52896 => '白銀',
- 53829 => '慶陽',
- 53829 => '慶陽',
- 53829 => '慶陽',
- 53829 => '慶陽',
- > 52533 => '酒泉',
- 57006 => '天水',
- 52679 => '武威',
- 52652 => '張掖',
- 50741 => '甘南' > 52984 => '臨夏',
- 53915 => '平涼',
- 52995 => '定西',
- 52675 => '金昌',
- 52866 => '西寧',
- 52866 => '西寧',
- 52866 => '西寧',
- 52754 => '海北',
- 52737 => '海西',
- 56065 => '黃南',
- 56043 => '果洛',
- 56029 => '玉樹' ,
- 52875 => '海東',
- 52856 => '海南',
- 57494 => '武漢',
- 57461 => '宜昌',
- 57498 => '宜昌> ',
- 57447 => '恩施',
- 57476 => '荊州',
- 57362 => '神農架',
- 57256 => '十堰',
- 57590> 57590 => '十堰',
- 57590 ',
- 57278 => '襄樊',
- 57482 => '孝感',
- 57381 => '隨州',
- 58407 => '黃門荊石', 57496 => '鄂州',
- 57679 => '長沙',
- 57766 => '邵陽',
- 57662 => '常德',
- 57972 => '常德',
- 57972 = 鎜> ',
- 57649 => '吉首',
- 57780 => '株洲',
- 57763 => '婁底',
- 57773 => '柹潭', 57866 => '永州',
- 57584 => '岳陽',
- 57872 => '衡陽',
- 57749 => '懷化',
- 57771 = 韶山> ',
- 57558 => '張家界',
- 58457 => '杭州',
- 58450 => '湖州',
- 58549 => '金波華',
- 585633 ',
- 58646 => '麗水',
- 58453 => '紹興',
- 58633 => '衢州',
- 58452 => '嘉興台州, 586600 ',
- 58477 => '舟山',
- 58659 => '溫州',
- 58606 => '南昌',
- 57786 => '萍^ ',
- 58637 => '上饒',
- 58617 => '撫州',
- 57799 => '吉安',
- 58627 => '鷹潭',
- 57793 => ' 5793 ',
- 57796 => '新餘',
- 58527 => '景德鎮',
- 57993 => '贛州',
- 58847 => '福州', 58927 => '龍岩',
- 58834 => '南平',
- 58846 => '寧德',
- 58946 => '田',
- ' 59137 ',
- 58828 => '三明',
- 59126 => '漳州',
- 57816 => '貴陽',
- 57806 => '安順水',
- 57609 ',
- 57713 => '遵義',
- 57741 => '銅仁',
- 56693 => '六盤水',
- 57707 => '畢節',
- 578255 =>裡',
- 57827 => '都勻',
- 56294 => '成都',
- 57602 => '瀘州',
- 57504 => '內江', '涼山',
- 56171 => '阿壩',
- 57313 => '巴中',
- 57206 => '廣元',
- 56386 => '樂山', '綿陽',
- 56198 => '德陽',
- 56666 => '攀枝花',
- 56287 => '雅安',
- 56492 => '宜賓',
- 5
- 56492 => '宜賓',
- 5 > '自貢',
- 56146 => '甘孜州',
- 57328 => '達州',
- 56298 => '資陽',
- 57415 => '廣安',
- 5
- 57415 => '廣安',
- 5
- 57415 => '廣安',
- 5
- 57415 => '廣安',
- 5
- 57415 => '廣安',
- 5
- 57415 => '廣安',
- 5 => '遂寧',
- 56391 => '眉山',
- 57411 => '南充',
- 59287 => '廣州',
- 59493 => '深圳',
- 593312 => '潮州',
- 59082 => '韶關',
- 59658 => '湛江',
- 59298 => '惠州',
- 59280 => '清遠', '東莞',
- 59473 => '江門',
- 59659 => '茂名',
- 59278 => '肇慶',
- 59501 => '江尾', => '河源',
- 59315 => '揭陽',
- 59117 => '梅州',
- 59485 => '中山',
- 59269 => '德慶', 59663 => '陽江', 59471 => '雲浮', 59488 => '珠海', 59316 => '汕頭', 59431 => '南寧', 57957 => '桂林', 59051 => '陽朔', 59046 => '柳州', 59265 => '梧州', 59453 => '玉林', '玉林', '玉林', ' 59254 => '桂平', 59065 => '賀州', 59632 => '欽州', 59249 => '貴港', 59635 => '防城港', 59635 => '防城港', '百色',59644 => '北海',
- 59023 => '河池',
- 59242 => '來賓',
- 59425 => '崇左',
- 56778 => '昆明',
- 56748 => '保山',
- 56768 => '楚雄',
- 56844 => '德宏',
- 56975 => '紅河',
- 56951 => '臨滄',
- 56533 => '怒江',
- 56783 => '曲靖',
- 56964 => '思茅',
- 56994 => '文玉山',
- 56875 = '文玉溪'
- 56586 => '昭通',
- 56651 => '麗江',
- 56751 => '大理',
- 59758 => '海口亞',
- 59948 = '三亞亞',
- 59948 = '三亞亞'
- 59845 => '儋州',
- 59757 => '瓊山',
- 59941 => '通甚',
- 59856 => '文昌',
- 51463 => '文昌',
- 51463 => '烏魯木齊',
- 51076 => '阿勒泰',
- 51628 => '阿克蘇',
- 51368 => '昌吉',
- 52203 => '哈密',
- '5182和田',
- 51709 => '喀什',
- 51243 => '克拉瑪依',
- 51356 => '石河子',
- 51133 => '塔城',
- 51🎜> 51133 => '塔城',
- '庫爾勒',
- 51573 => '吐魯番',
- 55591 => '拉薩',
- 55437 => '阿里',
- 56137 => '昌都', 55299> '那曲',
- 55578 => '日喀則',
- 55598 => '山南',
- 56312 => '林芝',
- 58968 => '台北', '高雄',
- 17060 => '伊斯坦堡ISTANBUL ',
- 40754 => '德黑蘭TEHRAN ',
- 41781 => '卡拉奇KARACHI ',
- 42182 = '新德里W. 🎜> 43466 => '科倫坡COLOMBO ',
- 47108 => '漢城SEOUL ',
- 47159 => '山BUSAN ',
- 47662 => '東京TOKYO ', 48454 => '曼谷BANGKOK ',
- 48647 => '吉隆坡KUALA LUMPUR ',
- 48820 => '河內HA NOI ',
- 96745 = 'AOI ' ,
- 10141 => '漢堡HAMBURG ',
- 10381 => '柏林BERLIN ',
- 10637 => '法蘭克福FRANKFURT ',
- 11034 => '維也納VIENNA ,FURT ',
- 11034 => '維也納VIENNA. > '米蘭MILANO ',
- 16235 => '羅馬ROMA ',
- 16701 => '雅典ATHENS ',
- 2484 => '斯德哥爾摩STOCKHOLM ',
- 27612 => '斯德哥爾摩
- 3334 => '曼徹斯特MANCHESTER ',
- 3779 => '倫敦LONDON ',
- 6240 => '阿姆斯特丹AMSTERDAM ',
- 6451 => '布魯塞爾BRUSSELES ',
- 6660 => 6660 '蘇黎世ZURICH ',
- 6700 => '日內瓦GENEVE ',
- 61291 => '巴馬科BAMAKO ',
- 63450 => '亞的斯亞貝巴ADDIS ABABA ',
- 63450 => '亞的斯亞貝巴ADDIS ABABA ',
- 63740 => '內羅畢NAIROBI ',
- 65472 => '阿克拉ACCRA ',
- 67341 => '馬普托MAPUTO ',
- 68368 => '約翰尼斯堡JOHANNESBURG ',
- 68368 => '約翰尼斯堡JOHANNESBURG ',
- '68396 = '曼齊尼MANZINI ',
- 68816 => '開普敦CAPE TOWN ',
- 71624 => '多倫多TORONTO ',
- 71627 => '蒙特利爾MONTREAL ',
- 716288 OTTAWA ',
- 71892 => '溫哥華VANCOUVER ',
- 72202 => '邁阿密MIAMI ',
- 72219 => '亞特蘭大ATLANTA ',
- 72243 => '休士頓HOUSTON, ' 72295 => '洛杉磯LOS ANGELES ',
- 72386 => '拉斯維加斯LAS VEGAS ',
- 72403 => '華盛頓WASHINGTON DC ',
- 72503 => '紐約NEW YORK ',
- 72509 => '波士頓BOSTON ',
- 72530 => '芝加哥CHICAGO ',
- 72793 => '西雅圖SEATTLE ',
- 78264 => '聖地牙哥SANTIAGO DE CUBA ',
- 78264 => '聖地牙哥SANTIAGO DE CUBA ',
- 80264 => > '波哥大BOGOTA ',
- 84628 => '利馬LIMA ',
- 85799 => '蒙特港PUERTO MONTT ',
- 87585 => '布宜諾斯艾利斯BUENOS AIRES ',
- 93110 => '奧克蘭AUCKLAND ',
- 93436 => '威靈頓WELLINGTON ',
- 94767 => '雪梨SYDNEY ',
- 94868 => '墨爾本MELBOURNE ' 9426 = '326 =>坎培拉CANBERRA ',
- 59279 => '佛山',
- 53753 => '呂梁',
- 51431 => '伊寧');
?>
複製程式碼
-
header('Content-type:text/html;charset=utf-8');
-
- require_once 'city.php'
- @error_reporting(0);
- if($_POST['submit'] === '確定')
- {
- $client = new SoapClient('http://www.webxml . com.cn/WebServices/WeatherWebService.asmx?wsdl');
- $code = $_POST['city'];
- //$code = '深圳';
- $para = array(' theCityName '=>$code);
- $res = $client->__Call('getWeatherbyCityName',array('paramters'=>$para))->getWeatherbyCityNameResult->string;
- echo "
" ;
- echo "城市:".$res[1];
- echo "
黃昏:".$res[5];
- echo "
天氣:".$ res[6];
- echo "
風力:".$res[7];
- echo "";
- //$qq = $_POST['qqnum'] ;
- $qq = '260558820';
- if(!empty($qq))
- {
- if(preg_match('/^) d+$/',$qq))
- {
- $client = new SoapClient('http://www.webxml.com.cn/webservices/qqOnlineWebService.asmx?wsdl',array('trace'= >1));
- $para = 陣列('qqCode'=>$qq);
- $res = $client->__Call('qqCheckOnline',array('paramters'=>$ para))->qqCheckOnlineResult;
- echo $qq.' 目前'.($res=='Y'?'在線':'離線');
- }
- else
- {
- echo 'QQ號碼錯誤 ;' ;
- }
- }
- }
- ?>
複製程式碼
|