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Éú³É
Ïà¹ØÎĵµ£º
PHP»º´æ´úÂë
ºÃµÄÒ³Ãæ»º´æ´úÂ룬¿ÉÒÔ¼õÇáCPUºÍMYSQL¸ºµ£¡£Ê¹ÓÃǰ£¬ÏÈÔÚ¸ùĿ¼´´½¨“cache”Îļþ¼Ð£¬È»ºóÔËÐÐ1.php£¬µÚÒ»´ÎÔËÐк͵ڶþ´ÎÔËÐÐËٶȲîÒìºÜ´ó¡£»¶ÓÊìϤPHPµÄÅóÓÑʹÓúÍÌáÒâ¼û¡£
ʹÓ÷½·¨:(Çë±£´æÎªtemp.php)
<?php
include('arrcache.php');
$cache = new ArrCache('cache',5,'txt');
......
<!-- xml¸ñʽ
<foo xmlns="test">
<bar attr='a'></bar>
<bar attr='b'></bar>
<bar attr='c'></bar>
</foo>
-->
<?php
$dom = new DOMDocument();
if (!$dom->load('attr.xml'))
{
echo "load books.xml failed!<br>";
re ......
½ü
À´Ëæ×Åi18n(¹ú¼Ê»¯)µÄÖð½¥±ê×¼»¯£¬ÎÒÒ²À´½²Ò»½²ÔÚPHPÖÐÈçºÎʵÏÖ¹ú¼Ê»¯Ö§³Ö¡£¸úÆäËû³ÌÐòÓïÑÔÒ»Ñù£¬ÔÚ PHP Ò²¿ÉÒÔÀûÓà gettext
Ì×¼þд×÷ i18n ³ÌÐò£¬ÊµÏÖ NLS(Native Language Support) ¹ú¼Ê»¯Ö§³Ö£¬¾ßÌåÇë²Î¿¼¹Ù·½Îĵµ(
http://www.gnu.org/software/gettext/manual/gettext.html
)
ÕâÀïÎÒÃÇÖ÷Òª½éÉÜwindowƽ̨ÏÂÊ ......
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 ......
ÔÚjavascriptÖÐÓ÷¨¾ÙÀý
var rule = /^\d+$/;
if(!rule.test(addform.rmb_price.value)) {
alert('rmb_price must be number');
addform.rmb_price.focus();
return false;
}
ÔÚphpÖÐÓ÷¨¾ÙÀý
$aa = "/^\d+$/";
if(preg_match($aa, "111")) {
echo "found";
}
ÔÚjavaÖÐÓ÷¨¾ÙÀý ......