aso*_*ahu 0 php arrays string associative
我有这样的字符串
{"status":"2","holding":"","company":"Company","nik":"8981237","name":"Markonah","ownercard":"Istri"}
Run Code Online (Sandbox Code Playgroud)
如何将此字符串转换为 PHP 中的关联数组
它的 JSON,要转换为数组使用json_decode():
$string = '{"status":"2","holding":"","company":"Company","nik":"8981237","name":"Markonah","ownercard":"Istri"}';
$my_array = json_decode($string,true);
echo $my_array["status"]; // output: 2
Run Code Online (Sandbox Code Playgroud)