-1

How i Access LocalId Key Value in Php. This Array is Json Endcoded

{"0":{"kind":"identitytoolkit#VerifyPasswordResponse","localId":"u0iuiF09idQ1pEl0oJTfElqTtXr1"}}

1 Answers1

0
$arr = json_decode($your_string, true); // assign it to a variable
echo $arr[0]["localId"]; // --> your question
Alp Altunel
  • 3,324
  • 1
  • 26
  • 27
  • He is asking about an array while his code contains an object, This will work instead `echo $arr->0->localid;` – Zeko Oct 21 '20 at 05:21
  • -> operator will work on an object. true parameter to json_decode makes it array not object. – Alp Altunel Oct 21 '20 at 12:06