我有一个从验证器返回的json数组:
{ "email":["Email must not be empty","Email must be valid email"],
"password":["Password must not contain whitespace"],
"rpassword":["Rpassword must not be empty"]
}
数据是从(我的目的是获得第一个值“电子邮件不能为空”)知道'电子邮件'不一定总是第一个对象):
$data = json_decode($datas, true);
//echo $data[0][0]; // this is what was tried!