
Mohammad A. answered 02/19/20
Professional PHP developer with 10+ years of experience
The following code will check if the two parameters are set and then return json response:
The Data is dummy. In an actual case you might want to search the values i db and return the data as json.
Please let me know if you have any questions about this.