PHP and airport code operations
PHP and airport code operations
State as $ answer) {foreach ($ answer-> children () as $ a) // first traverse the subnode {foreach ($ a-> attributes () as $ B) // traverse the attributes of the subnode {if ($ threeword = $ B) {foreach ($ answer-> attributes () as $ c) {$ airport ["city"] = $ c;} $ airport ["name"] = $ a; return $ airport ;}}} return "no ";} $ result = change_to_chinese ("NAY"); echo $ result ["city"]; echo $ result ["name"];?>
2. [File] converts an airport to a three-character code
Load ('City. XML'); // read the xml file $ city = $ city_var; // Obtain the parameter $ airports = array (); // store the airport array $ states = $ doc-> getElementsByTagName ("state"); $ I = 0; $ j = 0; foreach ($ states as $ state) {if ($ city = $ states-> item ($ I)-> attributes-> item (0)-> nodeValue) {foreach ($ states-> item ($ I)-> childNodes as $ f) {array_push ($ airports, $ states-> item ($ I) -> childNodes-> item ($ j)-> nodeValue); $ j ++ ;}$ I ++ ;}$ result = array (); $ x = 0; for ($ k = 0; $ k
State as $ state) {foreach ($ state-> attributes () as $ city) {if ($ city_name = $ city) {foreach ($ state-> children () as $ a) {foreach ($ a-> attributes () as $ B) {$ three_word [$ I] = $ B; $ I ++ ;}}}}} return $ three_word;} $ result = change_to_threeword ("Beijing"); foreach ($ result as $ value) {echo $ value."
";}?>
3. [File] XML file
Harbin Taiping International Airport
Three sub-Airports in Qiqihar
Mudanjiang Hailang Airport
Jiamusi East suburb Airport
Heihe International Airport
Mohe Gulian Airport
Daqing saltu Airport
Jixi Xingkai Lake Airport
Yichun Lindu Airport
Changchun Longjia International Airport
Yanji Chaoyang Chuan International Airport
Ertaizi Airport, Jilin province
Dalian Zhoushuizi International Airport
Shenyang Taoxian International Airport
Jinzhou xiaolingzi Airport
Dandong Langtou Airport
Chaoyang Airport
Shijiazhuang Zhengding International Airport
Qinhuangdao Mountain Customs Airport
Handan Airport
Beijing Capital International Airport
Beijing South Carolina airport
Tianjin Binhai International Airport
Taiyuan Wusu International Airport
Datong Huairen Airport
Changzhi Wangcun Airport
Yuncheng Guan Gong Airport
Hohhot Baita International Airport
Baotou Erli half Airport
Wulanhot Ulanhot Airport
Hailar Dongshan Airport
Erdos Dongsheng Airport
Manzhouli Xijiao Airport
Xilinhot Airport
Chifeng Yulong Airport
Tongliao Airport
Wuhai Airport
Jinan Yaoqiang International Airport
Weihai grand waterfront International Airport
Qingdao Liuting International Airport
Weifang Wendeng Airport
Yantai Laishan airport
Linyi Airport
Dongying Yongan Airport
Jining Airport
Nanchang Changbei International Airport
Jiujiang Lushan Airport
Jingdezhen Luogang Airport
Jinggangshan Airport
Ganzhou Golden Airport
Huangshan Tunxi Yueqiao Airport
Hefei Luogang Airport
Anqing Dalongshan Airport
Fuyang Xiguan Airport
Hangzhou Xiaoshan International Airport
Wenzhou Yongqiang Airport
Zhoushan Putuo Airport
Ningbo Lishe International Airport
Yiwu Airport
Huangyan Luqiao Airport
Quzhou Airport
Nanjing Lukou International Airport
Xuzhou Guanyin Airport
Lianyungang Baita Port
Yancheng Airport
Wuxi Shuofang Airport
Changzhou benniu Airport
Nantong Xingdong Airport
Shanghai Hongqiao Airport
Shanghai Pudong Airport
Xiamen Gaoqi International Airport
Fuzhou Changle International Airport
Jinjiang Airport
Lian Cheng Airport
Wuyishan Airport
Guangzhou Huadu New Baiyun International Airport
Meixian Airport
Zhuhai Sanzao International Airport
Shantou Waisha Airport
Shenzhen Baoan International Airport
Zhanjiang Airport
Haikou Meilan International Airport
Sanya Phoenix International Airport
Wuhan Tianhe International Airport
Jingzhou Sha-Shi Airport
Xiangfan Liuji Airport
Yichang Three Gorges Airport
Enshi Xujiaping Airport
Zhangjiajie Huadong Airport
Changsha Huanghua International Airport
Changde Peach Blossom Source Airport
Huaihua Lujiang Airport
Hengyang Airport
Zhengzhou Xinzheng International Airport
Luoyang north suburb Airport
Nanyang Jiangying Airport
Nanning Wuzhi International Airport
Guilin Liangjiang International Airport
Beihai Fucheng Airport
Liuzhou Bailian Airport
Baise Tianyang Airport
Wuzhou Changzhou Airport
Xi'an Xianyang International Airport
Hanzhong Xiguan Airport
Yan'an 20th Fort Airport
Ankang Wulipu Airport
Yulin Xisha Airport
Lanzhou Zhongchuan Airport
Dunhuang Airport
Jiayuguan Airport
Qingyang Xifeng town Airport
Xining caojiapu Airport
Golmud Airport
Yinchuan Hedong Airport
Urumqi International Airport
Hotan Airport
Inning Airport
Karamay Airport
Tacheng Airport
Altay Airport
Aksu Airport
Korla Airport
Kuche Airport
Kashgar Airport
Qemo Airport
Hami Airport
Cocatoto sea Airport
Chengdu Shuangliu International Airport
Mianyang Nanjiao Airport
Yibin caiba Airport
Luzhou Airport
Jiuzhaigou Huanglong Airport
Panzhihua security camp Airport
Xichang Qingshan Airport
Wanxian Airport
Guangyuan Panlong Airport
Daxian Heba Airport
Nanchong duweiba Airport
Liangping Wanzhou Liangping Airport
Guanghan Airport
Chongqing Jiangbei International Airport
Chongqing Wanzhou Wuqiao Airport
Guiyang Longdongbao International Airport
Liping Airport
Tongren Daxing Airport
Xingyi Airport
Kunming Wujiaba International Airport
Lijiang Sanyi Airport
Xishuangbanna Airport
Dali Airport
Mangshiji Airport
Diqing Shangri-La Airport
Simao Airport
Baoshan Airport
Lincang Airport
Wenshan Puzhehei Airport
Tengchong
Zhaotong Airport
Lhasa Gongga Airport
Qamdo Bangda Airport
Nyingchi
The above is the PHP and airport operations. For more information, see PHP Chinese website (www.php1.cn )!