Today I'm trying to get some datas from an PHP array but I don't know how to do this because I'm not supposed to know the name of the first key.
Array
(
[5bnuQsT1Y4S9yk8LRhBeLtT5PWqoAYrv2XlIGu1A] => Array
(
[token] => TeamSpeak3_Helper_String Object
(
[string:protected] => 5bnuQsT1Y4S9yk8LRhBeLtT5PWqoAYrv2XlIGu1A
[position:protected] => 0
)
[token_type] => 0
[token_id1] => 8
[token_id2] => 0
[token_created] => 1465668613
[token_description] =>
)
[df01kyz5BWtgFXDFT+70g5oSze2e3WijYEfbOSDO] => Array
(
[token] => TeamSpeak3_Helper_String Object
(
[string:protected] => df01kyz5BWtgFXDFT+70g5oSze2e3WijYEfbOSDO
[position:protected] => 0
)
[token_type] => 0
[token_id1] => 8
[token_id2] => 0
[token_created] => 1465668966
[token_description] =>
)
)
I would like to get the value of each key called [string:proected]
I tried to vardump this : $array[0][0] and this : $array[0] but they are set to NULL.
When I do vardump($array["5bnuQsT1Y4S9yk8LRhBeLtT5PWqoAYrv2XlIGu1A"]["token"] I get only the object, but I still need to set a loop to get all the strings.
Can you help me with that?
Thanks!
reset( $array )php.net/manual/en/function.reset.php, to get the first element of an array, for eachstring:protected, this should helpfor each