How to debug AJAX response in PHP

The simplest way to debug a normal PHP request is using the echo to output messages to browser, but in AJAX, it's not working.

In an AJAX request, the response usually was not displayed on screen, but processed in Javascript. If it's a GET request, you can type the URL directly, if it's a POST request, there are no easy ways to make the request and display the output in the front end.

Without other facilities, the only way to debug it is to set the breakpoint at the place where the AJAX response is received and check its value in your debugger for example in Chrome Developer Tools.