Hello,
I'm currently working on a project and I need to get the values I need from the API server.
I'm really new to working with objects and arrays alltogheter, can I have a little help and perhaps someone can provide a simple example on how I can do this ?
The code I get when quering the API server is as follow:
xmlrpcresp Object
(
[val] => xmlrpcval Object
(
[me] => Array
(
[array] => Array
(
[0] => xmlrpcval Object
(
[me] => Array
(
[struct] => Array
(
[id] => xmlrpcval Object
(
[me] => Array
(
[string] => numberIdOfItem
)
[mytype] => 1
[_php_class] =>
)
[name] => xmlrpcval Object
(
[me] => Array
(
[string] => nameOfGroupItem
)
[mytype] => 1
[_php_class] =>
)
[origin] => xmlrpcval Object
(
[me] => Array
(
[string] => ItemDetail1
)
[mytype] => 1
[_php_class] =>
)
[vhost] => xmlrpcval Object
(
[me] => Array
(
[string] => ItemDetail2
)
[mytype] => 1
[_php_class] =>
)
[ip] => xmlrpcval Object
(
[me] => Array
(
[string] => 3518896588
)
[mytype] => 1
[_php_class] =>
)
[compression] => xmlrpcval Object
(
[me] => Array
(
[string] => 1
)
[mytype] => 1
[_php_class] =>
)
[vanity_ip] => xmlrpcval Object
(
[me] => Array
(
[string] => IPADDRESS
)
[mytype] => 1
[_php_class] =>
)
)
)
[mytype] => 3
[_php_class] =>
)
)
)
[mytype] => 2
[_php_class] =>
)
[valtyp] => xmlrpcvals
[errno] => 0
[errstr] =>
[payload] =>
[hdrs] => Array
(
[server] => nginx
[date] => Sun, 26 Aug 2012 10:19:27 GMT
[content-type] => text/xml; charset=utf-8
[transfer-encoding] => chunked
[connection] => keep-alive
[set-cookie] => PHPSESSID=bq1hp6ltjqqd6o8oo9el1otfc6; path=/
[expires] => Thu, 19 Nov 1981 08:52:00 GMT
[cache-control] => no-store, no-cache, must-revalidate, post-check=0, pre-check=0
[pragma] => no-cache
)
[_cookies] => Array
(
[PHPSESSID] => Array
(
[value] => bq1hp6ltjqqd6o8oo9el1otfc6
[path] => /
)
)
[content_type] => text/xml
[raw_data] => HTTP/1.1 200 OK
Server: nginx
Date: Sun, 26 Aug 2012 10:19:27 GMT
Content-Type: text/xml; charset=utf-8
Transfer-Encoding: chunked
Connection: keep-alive
Set-Cookie: PHPSESSID=bq1hp6ltjqqd6o8oo9el1otfc6; path=/
Expires: Thu, 19 Nov 1981 08:52:00 GMT
Cache-Control: no-store, no-cache, must-revalidate, post-check=0, pre-check=0
Pragma: no-cache
I know how to get the values from arrays and objects but only from simple ones, so I'm not sure how I can do to get "numberIdOfItem","nameOfGroupItem","ItemDetail1","ItemDetail2".
Also this would be a list of items, so I belive I really need to use a loop to get what I need from there.
Can I please have some help to start on with this ? At least how to get the values from the arrays in the above objects.
Thank you in adavance!