It is best and effective way to return data when you want to return multiple values as a response from AJAX.
You couldn’t directly return an array from AJAX, it must have converted in the valid format.
In this case, you can either use XML or JSON format.
In the tutorial demonstration, I will return an array of users from AJAX, while return converts the array into JSON format using the json_encode() function in the PHP.
On the basis of response show data in tabular format.