How to use the error suppressor in php: First create a new [Error.php] file and declare the file type and encoding for PHP to interact with the browser; then use the error suppressor [@] and enter [if. .else...] statement as a judgment; finally run the web page, you can see that the error message of the MySql statement is not output.
The operating environment of this tutorial: Windows 7 system, PHP version 5.6, DELL G3 computer.
How to use error suppressors in php:
1. Create a new Error.php file, as shown in the figure:
2. Declare the file type and encoding for PHP interaction with the browser, as shown in the figure:
3. The meaning of the error suppressor (@):
4. Application scenario, connect to MySql database, as shown in the figure:
5. Enter if..else...
statement is used as a judgment, as shown in the figure:
6. Run the web page and you can see that the error message of the MySql statement is not output. , only the information of the judgment statement is output, as shown in the figure:
## Related video recommendations:
The above is the detailed content of How to use php error suppressor. For more information, please follow other related articles on the PHP Chinese website!