Home php教程 php手册 php webservice 接口 实例 机票航班时刻表

php webservice 接口 实例 机票航班时刻表

Jun 13, 2016 am 09:34 AM
Example flight

<?php
header(&#39;Content-Type: text/html; charset=UTF-8&#39;);
$client = new SoapClient(&#39;http://webservice.webxml.com.cn/webservices/DomesticAirline.asmx?wsdl&#39;);	





$fromcity=!empty($_POST[&#39;fromcity&#39;]) ? trim($_POST[&#39;fromcity&#39;]) : &#39;长沙&#39;;
$tocity=!empty($_POST[&#39;tocity&#39;]) ? trim($_POST[&#39;tocity&#39;]) : &#39;广州&#39;;
$date=!empty($_POST[&#39;date&#39;]) ? trim($_POST[&#39;date&#39;]) : date(&#39;Y-m-d&#39;,time());



$parm=array(
&#39;startCity&#39;=>$fromcity,
&#39;lastCity&#39;=>$tocity,
&#39;theDate&#39;=>$date,
&#39;userID&#39;=>&#39;&#39;
);




$city=$client->getDomesticCity();
$city=get_object_vars($city);  
$city=$city[&#39;getDomesticCityResult&#39;]->any;

//print_r($city);
//var_dump($city);
$city_xml = simplexml_load_string($city); 





$result=$client->getDomesticAirlinesTime($parm);
$result=get_object_vars($result);  
$result=$result[&#39;getDomesticAirlinesTimeResult&#39;]->any;
//print_r($result[&#39;getDomesticAirlinesTimeResult&#39;]->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>&#160;
                    
                </td>
            </tr>
            <tr>
                <td>
                    
                        </td>
            </tr>
            <tr>
                <td align="center">
                    <strong>WebXml.com.cn</strong><strong>
                         航班时刻表 Web Service 实例</strong></td>
            </tr>
            <tr>
                <td>&#160;
                    
                </td>
            </tr>
            <tr>
                <td>   
                </td>
            </tr>
            <tr>
                <td>&#160;
                    
                </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 &#39;不停&#39;;else{echo &#39;停&#39;;} ?>
                                    </td>
                                </tr>
                           
                            <?php  }?>
                    </table>
                </td>
            </tr>
      
        </table>

</body>
</html>
Copy after login

Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn

Hot AI Tools

Undresser.AI Undress

Undresser.AI Undress

AI-powered app for creating realistic nude photos

AI Clothes Remover

AI Clothes Remover

Online AI tool for removing clothes from photos.

Undress AI Tool

Undress AI Tool

Undress images for free

Clothoff.io

Clothoff.io

AI clothes remover

Video Face Swap

Video Face Swap

Swap faces in any video effortlessly with our completely free AI face swap tool!

Hot Tools

Notepad++7.3.1

Notepad++7.3.1

Easy-to-use and free code editor

SublimeText3 Chinese version

SublimeText3 Chinese version

Chinese version, very easy to use

Zend Studio 13.0.1

Zend Studio 13.0.1

Powerful PHP integrated development environment

Dreamweaver CS6

Dreamweaver CS6

Visual web development tools

SublimeText3 Mac version

SublimeText3 Mac version

God-level code editing software (SublimeText3)

SVM examples in Python SVM examples in Python Jun 11, 2023 pm 08:42 PM

Support Vector Machine (SVM) in Python is a powerful supervised learning algorithm that can be used to solve classification and regression problems. SVM performs well when dealing with high-dimensional data and non-linear problems, and is widely used in data mining, image classification, text classification, bioinformatics and other fields. In this article, we will introduce an example of using SVM for classification in Python. We will use the SVM model from the scikit-learn library

How to track flights on iPhone How to track flights on iPhone Mar 27, 2024 pm 01:21 PM

Flight tracker apps are becoming a popular way to keep an eye on planes in the sky. Whether it's a flight for you or for someone you care about, these apps provide real-time updates to ensure your flight goes as planned. On iPhone, flight tracking does not require the installation of third-party apps as it is a built-in feature of the operating system, allowing users to easily track flight status. This feature makes it easier for people to plan their travels and ensure their or someone they care about’s flight goes smoothly. The ability to track flights in iOS is thanks to the data detectors that Apple has integrated into the system. Data detectors can identify information such as time, date and address and convert these into clickable links in the correct context

It was revealed that Juneyao Airlines did not turn on the air conditioning, causing heatstroke among passengers. The official apologized and informed the situation It was revealed that Juneyao Airlines did not turn on the air conditioning, causing heatstroke among passengers. The official apologized and informed the situation Jul 16, 2024 am 11:48 AM

According to news from this website on July 5, on July 3, some netizens revealed that a Juneyao Airlines flight was delayed for unknown reasons and the air conditioning was not turned on in the cabin, causing passengers to suffer from heat stroke. On the evening of July 4, Juneyao Airlines released the "Instructions on the Situation of Flight HO1851 on July 3" on its official Weibo, apologizing for the passenger's heatstroke. Juneyao Airlines sincerely apologizes for the passenger discomfort caused by poor cabin air conditioning during preparation for departure of flight HO1851. It has been confirmed that Juneyao Airlines will operate flight HO1851 from Hongqiao to Guangzhou on July 3. The flight was originally scheduled to take off at 18:10, but was delayed until 19:20 due to weather conditions. The flight completed boarding at 17:56 that day. Considering that the air-conditioning capacity of one side of the aircraft was weak, while the passengers were waiting to take off, the crew opened the aircraft door and arranged for the bridge to carry passengers.

Learn best practice examples of pointer conversion in Golang Learn best practice examples of pointer conversion in Golang Feb 24, 2024 pm 03:51 PM

Golang is a powerful and efficient programming language that can be used to develop various applications and services. In Golang, pointers are a very important concept, which can help us operate data more flexibly and efficiently. Pointer conversion refers to the process of pointer operations between different types. This article will use specific examples to learn the best practices of pointer conversion in Golang. 1. Basic concepts In Golang, each variable has an address, and the address is the location of the variable in memory.

VUE3 Getting Started Example: Making a Simple Video Player VUE3 Getting Started Example: Making a Simple Video Player Jun 15, 2023 pm 09:42 PM

As the new generation of front-end frameworks continues to emerge, VUE3 is loved as a fast, flexible, and easy-to-use front-end framework. Next, let's learn the basics of VUE3 and make a simple video player. 1. Install VUE3 First, we need to install VUE3 locally. Open the command line tool and execute the following command: npminstallvue@next Then, create a new HTML file and introduce VUE3: &lt;!doctypehtml&gt;

VAE algorithm example in Python VAE algorithm example in Python Jun 11, 2023 pm 07:58 PM

VAE is a generative model, its full name is VariationalAutoencoder, which is translated into Chinese as variational autoencoder. It is an unsupervised learning algorithm that can be used to generate new data, such as images, audio, text, etc. Compared with ordinary autoencoders, VAEs are more flexible and powerful and can generate more complex and realistic data. Python is one of the most widely used programming languages ​​and one of the main tools for deep learning. In Python, there are many excellent machine learning and deep

PHP simple web crawler development example PHP simple web crawler development example Jun 13, 2023 pm 06:54 PM

With the rapid development of the Internet, data has become one of the most important resources in today's information age. As a technology that automatically obtains and processes network data, web crawlers are attracting more and more attention and application. This article will introduce how to use PHP to develop a simple web crawler and realize the function of automatically obtaining network data. 1. Overview of Web Crawler Web crawler is a technology that automatically obtains and processes network resources. Its main working process is to simulate browser behavior, automatically access specified URL addresses and extract all information.

The relationship between the number of Oracle instances and database performance The relationship between the number of Oracle instances and database performance Mar 08, 2024 am 09:27 AM

The relationship between the number of Oracle instances and database performance Oracle database is one of the well-known relational database management systems in the industry and is widely used in enterprise-level data storage and management. In Oracle database, instance is a very important concept. Instance refers to the running environment of Oracle database in memory. Each instance has an independent memory structure and background process, which is used to process user requests and manage database operations. The number of instances has an important impact on the performance and stability of Oracle database.

See all articles