21,886
社区成员
发帖
与我相关
我的任务
分享
$array=array('i.h'=>'this:sayHello');'i.h'是key ,this:sayHello是value
print_r($array);//查看数组
<?php
//server.php
/*
*@link http://scripts.incutio.com/xmlrpc/
*/
include('class-IXR.php'); //xmlrpc解析类
class ihefeServer extends IXR_Server
{
function ihefeServer() {
$this->IXR_Server(array(
'i.h' => 'this:sayHello',
));
}
function sayHello($args) {
return 'HelloWorld!'.$args;
}
}
$serverd = new ihefeServer();
?>
//客户端
<?php
//client.php
include('class-IXR.php');
header("Content-Type:text/html;charset=utf-8");
$client = new IXR_Client('http://localhost/server.php'); //服务端
//$client->debug = true;
function show()
{
global $client;
if($client) {$response = $client->getResponse();}
else{echo "<h2>ihefe::Error! ".$client->getErrorCode().":".$client->getErrorMessage().'</h2>';}
print_r($response);
echo "<br/><hr/><br/>";
}
// Run a query for PHP
$client->query('i.h',"csdn");
show();
?>