AJAX data not coming to PHP
<p>I have JavaScript code to send the data to PHP.</p>

<p>Why I can't get the JSON data?</p>

<pre><code>xhr = new XMLHttpRequest();
var url = "http://192.168.1.4/temp.php";
xhr.open("POST", url, true);
xhr.setRequestHeader("Content-type", "application/json");
xhr.onreadystatechange = function() {
    if (xhr.readyState == 4 &amp;&amp; xhr.status == 200) {
        var json = JSON.parse(xhr.responseText);

    }
}

var aa = [{
    "email": "hey@mail.com",
    "password": "101010"
}, {
    email: 'lo@mail.com',
    "passqword": "112"
}];
xhr.send(aa);
</code></pre>

<p>And I have created the PHP code like this to get the data:</p>

<pre><code>&lt;?php
    header('Access-Control-Allow-Origin: *'); 
    header("Content-Type: application/json");
    header("Access-Control-Allow-Headers: Origin, X-Requested-With, Content-Type, Accept");
    $v = json_decode(stripslashes(file_get_contents("php://input")));
    echo $v;
?&gt;
</code></pre>