<?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
使用我们完全免费的人工智能换脸工具轻松在任何视频中换脸!

热门文章
Windows 11 KB5054979中的新功能以及如何解决更新问题
4 周前ByDDD
如何修复KB5055523无法在Windows 11中安装?
3 周前ByDDD
如何修复KB5055518无法在Windows 10中安装?
3 周前ByDDD
R.E.P.O.的每个敌人和怪物的力量水平
3 周前By尊渡假赌尊渡假赌尊渡假赌
蓝王子:如何到达地下室
3 周前ByDDD

热工具

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

螳螂BT
Mantis是一个易于部署的基于Web的缺陷跟踪工具,用于帮助产品缺陷跟踪。它需要PHP、MySQL和一个Web服务器。请查看我们的演示和托管服务。

MinGW - 适用于 Windows 的极简 GNU
这个项目正在迁移到osdn.net/projects/mingw的过程中,你可以继续在那里关注我们。MinGW:GNU编译器集合(GCC)的本地Windows移植版本,可自由分发的导入库和用于构建本地Windows应用程序的头文件;包括对MSVC运行时的扩展,以支持C99功能。MinGW的所有软件都可以在64位Windows平台上运行。

mPDF
mPDF是一个PHP库,可以从UTF-8编码的HTML生成PDF文件。原作者Ian Back编写mPDF以从他的网站上“即时”输出PDF文件,并处理不同的语言。与原始脚本如HTML2FPDF相比,它的速度较慢,并且在使用Unicode字体时生成的文件较大,但支持CSS样式等,并进行了大量增强。支持几乎所有语言,包括RTL(阿拉伯语和希伯来语)和CJK(中日韩)。支持嵌套的块级元素(如P、DIV),

Atom编辑器mac版下载
最流行的的开源编辑器