let xhr = new XMLHttpRequest();
xhr.open("POST", 'http://localhost/test.php', true);
xhr.setRequestHeader("Content-type", "application/json");
xhr.onreadystatechange = function(){
if(xhr.readyState === XMLHttpRequest.DONE && xhr.status === 200){
console.log(JSON.parse(xhr.responseText));
}
}
xhr.send(JSON.stringify(m_data));
header('Content-Type: application/json');
$post = file_get_contents('php://input');
echo json_encode($post);