How to remove variables from an array?

Array ( [result] => Array ( [@attributes] => Array ( [name] => getPlayerInfo [success] => 0 ) [returnset] => Array ( [error] => Array ( [@attributes] => Array ( [value] => GameRequest does not exist with token=token ) ) [errorCode] => Array ( [@attributes] => Array ( [value] => 2000 ) ) ) ) ) 

Closed due to the fact that off-topic participants Edward , 0xdb , user192664, Naumov , Jarvis_J 7 Nov '18 at 15:11 .

It seems that this question does not correspond to the subject of the site. Those who voted to close it indicated the following reasons:

  • “Questions asking for help with debugging (“ why does this code not work? ”) Should include the desired behavior, a specific problem or error, and a minimum code for playing it right in the question . Questions without an explicit description of the problem are useless for other visitors. See How to create minimal, self-sufficient and reproducible example . " - 0xdb, Naumov, Jarvis_J
  • "The question is caused by a problem that is no longer reproduced or typed . Although similar questions may be relevant on this site, solving this question is unlikely to help future visitors. You can usually avoid similar questions by writing and researching a minimum program to reproduce the problem before publishing the question. " - Edward, Community Spirit
If the question can be reformulated according to the rules set out in the certificate , edit it .

  • What is your problem? - Let's say Pie
  • I can’t get the values ​​for example [errorCode] [value] => 2000, I can’t get the value 2000, etc. - Erise Wdg
  • I added the answer, look - Let's say Pie
  • if the answer helped you, click the green check mark next to it. - Let's say Pie

1 answer 1

 $array = [ 'result' => [ '@attributes' => ['name' => 'getPlayerInfo', 'success' => 0], 'returnset' => [ 'error' => [ '@attributes' => ['value' => 'GameRequest does not exist with token=token'] ], 'errorCode' => [ '@attributes' => ['value' => 2000] ] ] ] ]; echo $array['result']['returnset']['errorCode']['@attributes']['value']; // 2000 
  • Thank!!! Very tired! - Erise Wdg