D
D
DireX2015-11-11 04:13:30
PHP
DireX, 2015-11-11 04:13:30

How to translate the response from the flex server into a normal object?

Good afternoon. I'm making a flex application parser in php. I am using the SabreAMF library. Everything is fine, the data is being received and sent. Only here the answer comes like this:


Array
(
[SabreAMF_TypedObjectamfClassName] =>
[SabreAMF_TypedObjectamfData] => Array
(
[country] => RU
[totalOnlineInfo] => SabreAMF_TypedObject Object
(
[amfClassName:SabreAMF_TypedObject:private] =>
[amfData:SabreAMF_TypedObject:private] => Array
(
[activeCount ] => 47485
[onlineCount] => 3632
[maxPopulation] => 183349
[totalCount] => 63046
[internalActiveCount] => 30155
).....

Like a regular array, key - value. But when you try to turn inside it, an error pops up that "there is no such thing" ...
var_dump($response['SabreAMF_TypedObjectamfData']);
// Notice:  Undefined index: SabreAMF_TypedObjectamfData

Actually the question is, how to be and what to do in order to read data from the array normally?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
S
Stalker_RED, 2015-11-11
@Stalker_RED

Make echo gettype($response);Most likely there will be "object".
Then try like this:
echo $response->country;

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question