H5文件上传

//H5文件上传
$file.change(function(){
	for(k=0;k<this.files.length;k++){
		var file=this.files[k]
		var reader=new FileReader();
		(function(reader){
			reader.onloadend=function(){
				var base64=reader.result;
//call upload api
			}
		})(reader);
		reader.readAsDataURL(file)
	}
})

 

PHP扩展SOAP实例(WSDL)

php 的 soap 返回数组:

services.php文件:

<?php
class services {  
  /**
    * Getdnstatus one string from each other
    * 
    * @param string $dn The first string of the subtraction
    * @return array The status of the tel
   */
  public function getdnstatus($dn){
  	if($dn == "8101"){
  		$status_arr = array("1","通话","1");
  	}else{
  		$status_arr = array("0","空闲","0");
  	}
  	return serialize($status_arr);
  }
}  
  $server = new SoapServer('service.wsdl', array('soap_version' => SOAP_1_2));  
  $server->setClass("services");  
  $server->handle();  
?>

service.wsdl文件:

<?xml version='1.0' encoding='UTF-8'?>

<!-- WSDL file generated by Zend Studio. -->

<definitions name="service" targetNamespace="urn:service" xmlns:typens="urn:service" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/" xmlns:soapenc="http://schemas.xmlsoap.org/soap/encoding/" xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/" xmlns="http://schemas.xmlsoap.org/wsdl/">
	<message name="getdnstatus">
		<part name="dn" type="xsd:string"/>
	</message>
	<message name="getdnstatusResponse">
		<part name=<