NuSOAP array detection

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Treefrog

    NuSOAP array detection

    Hi,

    I'm using NuSOAP to call a web method, that returns an array of
    "accounts".

    The trouble is, when there's only one account, NuSOAP doesn't return an
    array, it just returns the associative array that is the account data.

    E.G.

    $data = someNuSOAPCall( ); // returns 1 account

    $data['id']
    $data['name']


    $data = someNuSOAPCall( ); // returns many accounts

    $data[0]['id']
    $data[0]['name']
    $data[1]['id']
    $data[1]['name']

    However, this makes using it a bit more complicated then I'd like. I
    need to detect if I have an array or accounts, or if I just have an
    account 'object', but how can I check for a difference, asside form
    using if (isset($data[0]))?

Working...