PHP code example of pear / xml_rpc2

1. Go to this page and download the library: Download pear/xml_rpc2 library. Choose the download type require.

2. Extract the ZIP file and open the index.php.

3. Add this code to the index.php.
    
        
<?php
require_once('vendor/autoload.php');

/* Start to develop here. Best regards https://php-download.com/ */

    

pear / xml_rpc2 example snippets




$options = array(
  'prefix' => 'package.'
);

$client = XML_RPC2_Client::create(
  'http://pear.php.net/xmlrpc.php',
  $options
);

try {
  $result = $client->info('XML_RPC2');
  print_r($result);
} catch (XML_RPC2_FaultException $e) {
  // The XMLRPC server returns a XMLRPC error
  die('Exception #' . $e->getFaultCode() . ' : ' . $e->getFaultString());
} catch (Exception $e) {
  // Other errors (HTTP or networking problems...)
  die('Exception : ' . $e->getMessage());
}