B.Kevin B.Kevin - 6 months ago 16
PHP Question

Extract variable from Std Object

here is the output of a var_dump of my variable $result

stdClass Object(
[20365924] => stdClass Object(
[id] => 20365924
[name] => Jack
[profileIconId] => 916
[summonerLevel] => 30
[revisionDate] => 1463062452000
)
)


how to save only the '916' inside a variable, i have tried many things without success...

thanx.

Answer

You can access it like this :

PHP

$variable = $result->20365924->profileIconId;