The following code sends (I hope so) a Javascript object to a php file through Jquery's ajax call.
var emails = {};
emails.name = email;
.
.
$('button.gmail').click(function() {
$.ajax({ url: path,
data: emails,
type: 'post',
success: function(status) {
alert(status);
}
});
});
how can I examine this object in PHP and retrieve its keys/values?
application/x-www-form-urlencodedstring, which will be available via$_POSTin PHP.print_r($_POST)in your PHP file, and the alert will show whatever you received in the PHP file, which should be exactly the same as whatever you sent ?