PHP doesn't natively know the difference between
associative arrays (read : hashes in Perl) and numeric
arrays (read : arrays in Perl).
The current encode function turns PHP array types into
XMLRPC array types even if they are required to be
I've used the following code to fix this, I've seen
some other implementations of this so mine is by no
means the only way to do this.
$foundIntKey is just a simple incrementer that counts
the number of numeric keys in the $php_val
array/object. After array traversal is complete, a
comparison is made to determine if all the array keys
are numeric, if so the xml rpc data type is array, else
the data type is struct.
case 'array': case 'object': $arr = array();
$foundIntKey = 0;
while (list($k,$v) =
//determine if all the
keys were ints..