Bambero wrote:
> Hello
>
> I have compiled my php with --with-xmlrpc option to use xmlrpc server.
> Everything works fine, but there is one problem.
>
> Array (indexed from 0):
> $array[0]
> $array[1]
> $array[2]
> is changed to xmlrpc 'array' type - thats ok.
>
> Array (with string indexes):
> $array['ad']
> $array['sd']
> $array['rd']
> is changed to xmlrpc 'struct' type - thats ok too.
>
> But array (indexed from 1):
> $array[1]
> $array[2]
> $array[3]
> is changed to xmlrpc 'array' type.
>
> Is it possible to change this type to xmlrpc 'struct' type ?

I'll bet that if you did:
$array['1'] = 'whatever';

it would turn into a struct.

The crucial difference being that your KEYS are strings in the ones that
get turned into struct.

I bet that you only need to set *ONE* array element key to a string if you
can't change all of them:

<?php
  //Force string key so XML uses struct, not array:
  $array['1'] = $array[1];
  unset($array[1]);
?>

No promise on what ORDER the key/values will come out if you do that -- If
you care about order, you're gonna have to re-do the whole array, almost
for sure.

-- 
Like Music?
http://l-i-e.com/artists.htm

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

Reply via email to