2. Easy use with PHP arrays

Dan Libby was kind enough to contribute two helper functions that make it easier to translate to and from PHP arrays. This makes it easier to deal with complex structures. At the moment support is limited to int, double, string, array and struct datatypes; note also that all PHP arrays are encoded as structs due to PHP not being (easily) able to tell the difference between a hash and a linear array.

These functions reside in xmlrpc.inc.

2.1. php_xmlrpc_decode

$arr=php_xmlrpc_decode($xmlrpc_val);
$xmlrpc_val;

Returns a PHP array stuffed with the values found in the xmlrpcval $xmlrpc_val, translated into native PHP types.

2.2. php_xmlrpc_encode

$xmlrpc_val=php_xmlrpc_encode($phpval);
$phpval;

Returns an xmlrpcval populated with the PHP values in $phpval. Works recursively on arrays and structs. Note that there's no support for non-base types like base-64 values or date-times.