I would like to send array to the server.
This is how i try to send the array:
jQuery(document).ready(function($){
$.ajax({
type: "POST",
url: "file.php",
datatype : "json",
data : JSON.stringify({ name: "Daniel", phone: "01234123456" }),
success: function(msg){
alert('Success!');
}
});
});
This is how i try to get the array in file.php
print_r($_POST);
print_r($_GET);
print_r(json_decode($_POST);
Of course in the firebug console i see the array but not on the page.