在php中提取json数据并打印
/我想在php页面中打印验证值/这是从php到javascript的方法:在php中提取json数据并打印,php,json,Php,Json,/我想在php页面中打印验证值/这是从php到javascript的方法: array(2) { ["data"]=> array(1) { ["MemberData"]=> array(1) { ["Verified"]=> string(1) "Y" } } ["error"]=> array(2) { ["code"]=
array(2) {
["data"]=> array(1)
{
["MemberData"]=> array(1)
{
["Verified"]=> string(1) "Y"
}
}
["error"]=> array(2)
{
["code"]=> string(0) ""
["text"]=> string(0) ""
}
}
然后您可以像在PHP端阅读普通文章一样阅读它
另一种方法是使用?verified='javascript_array_value'重新加载URL,并使用GET读取它无任何尝试?echo$array['data']['MemberData']['verified']??thanxxxx…但我只想用php来做。。
var ar = JSON.parse( '<?php echo json_encode($array) ?>' );
//ar[1]['MemberData']; //first memberdata value
console.log(ar[1]['MemberData'].value);
jQuery.ajax({
type: "POST",
url: 'xxxxxxx',
dataType: 'json',
data: {array:array, //here you can pass the verified value of the array or the whole array if you want
},
success: function(data) {
if(data.success == true){
}
},
error: function(data) {
if(data.success != true){
}
},
});