I know that you can get with getJSON the JSON array from PHP. But I cannot make it return the array so I can save it.
Is there a way to do this anyway?
For example if I made a function called getJSONInfo() and I want it to return the JSON array from PHP.
Example from answer of edwardmp:
$.getJSON("http://site.com/file.php?id=2", function(json){
var newArray = json;
});
var username = newArray.username;
$.getJSON()should work if I understand your question correctly.json_encodebefore sending it fromphp, too