|
Posted by Ming on 05/10/07 20:47
for the following code, why it uses $method = 'examples.getStateName';
instead of $method = 'getStateName'; or $method =
'examples.getStateName()'
What does "example" here mean? Thanks
<?php
// this is the default file name from the package
// kept here to avoid confusion over the file name
require 'utils.php';
// server settings
$host = 'betty.userland.com';
$port = 80;
$uri = '/RPC2';
// request settings
// pass in a number from 1-50; get the nth state in alphabetical order
// 1 is Alabama, 50 is Wyoming
$method = 'examples.getStateName';
$args = array(32); // data to be passed
// make associative array out of these variables
$request = compact('host', 'port', 'uri', 'method', 'args');
// this function makes the XML-RPC request
$result = xu_rpc_http_concise($request);
print "I love $result!\n";
?>
Navigation:
[Reply to this message]
|