เป็น Protocol ของ API ครับ
$server = "http://ping.feedburner.com";
$params = array('title', 'http://www.jquerytips.com');
$request = xmlrpc_encode_request('weblogUpdates.ping', $params, array('encoding'=>'utf-8'));
$context = stream_context_create(array('http' => array(
'method' => "POST",
'header' => "Content-Type: text/xml",
'content' => $request
)));
$file = file_get_contents($server, false, $context);
$response = xmlrpc_decode($file);
print_r($response);
ตัวอย่างข้างบนนี่ผมทำตัว ping เข้า Feedburner
function wpPostXMLRPC ($title,$body,$rpcurl,$username,$password,$categories=array(1))
{
$categories = implode(",", $categories);
$XML = "<title>$title</title>".
"<category>$categories</category>".
$body;
$params = array('','',$username,$password,$XML,1);
$request = xmlrpc_encode_request('blogger.newPost',$params);
$ch = curl_init();
curl_setopt($ch, CURLOPT_POSTFIELDS, $request);
curl_setopt($ch, CURLOPT_URL, $rpcurl);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
curl_setopt($ch, CURLOPT_TIMEOUT, 1);
curl_exec($ch);
curl_close($ch);
}
ข้างบนนี่เป็นตัวอย่าง function post to wp
อ้างอิงhttp://php.net/manual/en/book.xmlrpc.php
http://codeigniter.com/user_guide/libraries/xmlrpc.html
http://framework.zend.com/manual/en/zend.xmlrpc.html 