I am using jQuery Ajax with PHP. When I use post with jQuery Ajax, then it's send request to PHP (server). In my PHP code, I want to return status success or error. In case it error, send error code and error message, else, it success return success code and message.
How can I do that in jQuery Ajax with PHP?
Edit:
$.post(url, { id: id },
function(data) {
// success code do here.
});