Code has been added to clipboard!

Loops With PHP json_decode

Example
...
xmlhttp.onreadystatechange = function() {
    if (this.readyState == 4 && this.status == 200) {
        newObj = JSON.parse(this.responseText);
        for (x in newObj) {
            txt += newObj[x].name + "<br>";
        }
        document.getElementById("JSON").innerHTML = txt;
    }
};
...