[PHP] Return JSON array back to Jquery Turn Back
2017-12-25 11:28:05
PHP: (process.php)
$json = array();
$json[0] = "Code 1";
$json[1] = "Message";
echo json_encode($json);
AJAX (Jquery):
$("some_form").on('submit',(function(e) {e.preventDefault();jsons = new Array();$.ajax({type: "POST",url: "process.php",data: new FormData(this),contentType: false,cache: false,processData:false,success: function(data){jsons = data;alert(jsons[0]);alert(jsons[1]);},dataType:"json"});}));