I have problem with send json by AJAX.
var data = [{"name": "Will", "surname": "Smith", "age": "40"},{"name": "Willow", "surname": "Smith", "age": "15"}];
$.ajax({
type: "POST",
url: "ajax.php",
dataType: "json",
data: data,
success: function(response)
{
alert(response);
}
});
ajax.php
<?php
echo json_encode($_POST);
?>
And ajax alert response is[object Object]
How to get array in php side?
datato string byJSON.stringify