This is the way to do it from PHP to javascript:
var ar = JSON.parse( '<?php echo json_encode($array) ?>' );
//ar[1]['MemberData']; //first memberdata value
console.log(ar[1]['MemberData'].value);
and from javascript to php you need to use ajax
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){
}
},
});
And then you can read it like normal POST on PHP-side.
Otherway of doing it would be to reload the URL with ?verified=’javascript_array_value’ and read it with GET
1
solved extract json data in php and print it [closed]