php soap初识
打开php.ini的soap扩展
server.php
<?php
class math{
/**
* 加法
*
* @param integer $a
* @param integer $b
* @return integer
*
*/
public function add($a, $b){
return $a + $b;
}
}
$server = new SoapServer('http://localhost/math.wsdl',array('soap_version' => SOAP_1_2));
$server->setClass("math");
$server->handle();
?>
client.php
<?php
$client = new SoapClient('http://localhost/math.wsdl');
$result = $client->add(1,3);
echo $result;
?>
其中http://localhost/math.wsdl文件由zend studio生成
相关文档:
在我们的网站设计过程中,经常会用到多条件查询,本文的源码是一个二手房屋查询的例子。在本例中,我们要实现能够通过地理位置,物业类型,房屋价格,房屋面积及信息发布日期等多个条件查询到客户所需的资料。
查询文件(search.php)
一、生成查询语句:
以下为引用的内容:
<?
$conn=mysql_connect("localhost", ......
conn.php
<?php
/*
* Created on 2010-1-6
* Author:CHAUVET
* Function:连接字符串
*/
$conn=@mysql_connect("localhost","root","")or die("连接数据库出错!");
mysql_select_db("newdb",$conn);
mysql_query("set names 'gb2312'");
function ReplaceSom ......
JAVA文件读写必须要注意编码问题
java的文件写
直接使用FileWriter即可,第二个参数为追加写入,默认是覆盖写。写完必须close才会保存写好的内容。
默认情况如果没有会新建一个文件
FileWriter fw = null;
try {
fw = new FileWriter("/data/updatetime.dat", true); // true追加写入
fw.append ......
1.如果一个方法能被静态,那就声明他为静态的,速度可提高1/4;
2.echo的效率高于print,因为echo没有返回值,print返回一个整型;
3.在循环之前设置循环的最大次数,而非在在循环中;
4.销毁变量去释放内存,特别是大的数组;
5.避免使用像__get, __set, __autoload等魔术方法;
6.requiere_once()比较耗资源;
7.在i ......