<?php header('Content-Type: text/html; charset=UTF-8'); $client = new SoapClient('http://webservice.webxml.com.cn/webservices/DomesticAirline.asmx?wsdl'); $fromcity=!empty($_POST['fromcity']) ? trim($_POST['fromcity']) : '长沙'; $tocity=!empty($_POST['tocity']) ? trim($_POST['tocity']) : '广州'; $date=!empty($_POST['date']) ? trim($_POST['date']) : date('Y-m-d',time()); $parm=array( 'startCity'=>$fromcity, 'lastCity'=>$tocity, 'theDate'=>$date, 'userID'=>'' ); $city=$client->getDomesticCity(); $city=get_object_vars($city); $city=$city['getDomesticCityResult']->any; //print_r($city); //var_dump($city); $city_xml = simplexml_load_string($city); $result=$client->getDomesticAirlinesTime($parm); $result=get_object_vars($result); $result=$result['getDomesticAirlinesTimeResult']->any; //print_r($result['getDomesticAirlinesTimeResult']->any); $obj_xml = simplexml_load_string($result); //print_r($obj_xml->children()->children()); ?> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <meta http-equiv="Content-Type" content="text/html; charset=utf-8"> <title>WecXml.com.cn 火车时刻表 Web Service 实例</title> <style type="text/css"> <!-- @import url("css/c.css"); --> </style> </head> <body> <table width="80%" border="0" align="center" cellpadding="0" cellspacing="0"> <tr> <td>  </td> </tr> <tr> <td> </td> </tr> <tr> <td align="center"> <strong>WebXml.com.cn</strong><strong> 航班时刻表 Web Service 实例</strong></td> </tr> <tr> <td>  </td> </tr> <tr> <td> </td> </tr> <tr> <td>  </td> </tr> <tr> <td> <table width="100%" border="0" cellpadding="2" cellspacing="1" bordercolor="#FFFFFF" bgcolor="#E5005A"> <tr> <th style="background-color: #FFD7E7;"> 航空公司</th> <th style="width: 10%; background-color: #FFD7E7;"> 航班编号</th> <th style="width: 18%; background-color: #FFD7E7;"> 出发机场</th> <th style="width: 10%; background-color: #FFD7E7;"> 出发时间</th> <th style="width: 18%; background-color: #FFD7E7;"> 到达机场</th> <th style="width: 10%; background-color: #FFD7E7;"> 到达时间</th> <th style="width: 10%; background-color: #FFD7E7;"> 机型</th> <th style="width: 10%; background-color: #FFD7E7;"> 中途是否停</th> </tr> <?php foreach($obj_xml->children()->children() as $child) { ?> <tr> <td class="tdbg"> <?php echo $child->Company; ?> </td> <td class="tdbg" > <?php echo $child->AirlineCode; ?> </td> <td class="tdbg" > <?php echo $child->StartDrome; ?> </td> <td class="tdbg"> <?php echo $child->StartTime; ?> </td> <td class="tdbg"> <?php echo $child->ArriveDrome; ?> </td> <td class="tdbg"> <?php echo $child->ArriveTime; ?> </td> <td class="tdbg"> <?php echo $child->Mode; ?> </td> <td class="tdbg"> <?php if($child->AirlineStop==0) echo '不停';else{echo '停';} ?> </td> </tr> <?php }?> </table> </td> </tr> </table> </body> </html>
陳述
本文內容由網友自願投稿,版權歸原作者所有。本站不承擔相應的法律責任。如發現涉嫌抄襲或侵權的內容,請聯絡admin@php.cn

熱AI工具

Undresser.AI Undress
人工智慧驅動的應用程序,用於創建逼真的裸體照片

AI Clothes Remover
用於從照片中去除衣服的線上人工智慧工具。

Undress AI Tool
免費脫衣圖片

Clothoff.io
AI脫衣器

Video Face Swap
使用我們完全免費的人工智慧換臉工具,輕鬆在任何影片中換臉!

熱門文章
刺客信條陰影:貝殼謎語解決方案
4 週前ByDDD
Windows 11 KB5054979中的新功能以及如何解決更新問題
3 週前ByDDD
在哪裡可以找到原子中的起重機控制鑰匙卡
4 週前ByDDD
<🎜>:死鐵路 - 如何完成所有挑戰
1 個月前ByDDD
Atomfall指南:項目位置,任務指南和技巧
1 個月前ByDDD

熱工具

mPDF
mPDF是一個PHP庫,可以從UTF-8編碼的HTML產生PDF檔案。原作者Ian Back編寫mPDF以從他的網站上「即時」輸出PDF文件,並處理不同的語言。與原始腳本如HTML2FPDF相比,它的速度較慢,並且在使用Unicode字體時產生的檔案較大,但支援CSS樣式等,並進行了大量增強。支援幾乎所有語言,包括RTL(阿拉伯語和希伯來語)和CJK(中日韓)。支援嵌套的區塊級元素(如P、DIV),

VSCode Windows 64位元 下載
微軟推出的免費、功能強大的一款IDE編輯器

SublimeText3漢化版
中文版,非常好用

禪工作室 13.0.1
強大的PHP整合開發環境

ZendStudio 13.5.1 Mac
強大的PHP整合開發環境