Home >PHP Framework >ThinkPHP >How to determine whether it is an ajax request in thinkphp5
Open the thinkphp5 project file.
Add comments to this program.
Related recommendations: "ThinkPHP Tutorial"
Create a new method isajax.
Introduce the request object.
Determine whether an ajax request is made through the isAax method.
Print the judgment result.
Create a post request and click submit. The result shows false, indicating that it is not an ajax request.
The above is the detailed content of How to determine whether it is an ajax request in thinkphp5. For more information, please follow other related articles on the PHP Chinese website!