在php中将响应字符串转换为数组
我通过auth API获得字符串:在php中将响应字符串转换为数组,php,arrays,Php,Arrays,我通过auth API获得字符串: ({ "token":"eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ...", "user": { "uid":"lda...", "sn":"Hugo", "mail":"abc@bla.com", "mobile":"" } }) 我已经尝试了json解码($ldapResponse)->user->uid,但是 尝试获取非对象的属
({
"token":"eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ...",
"user":
{
"uid":"lda...",
"sn":"Hugo",
"mail":"abc@bla.com",
"mobile":""
}
})
我已经尝试了json解码($ldapResponse)->user->uid,但是
尝试获取非对象的属性时出错
出现了。
如何将此字符串转换为数组并在php中获取uid
的值?使用
使用
读
$array= json_decode($your_json, TRUE);`