PHP pre-added at matching @ function analysis, phpat. PHP pre-added at match @. when we are working on PHP projects, we always add the @ symbol before some code lines. do you know what it means? Next I will share with you the role of @ in PHP before the function PHP, phpat
When you are working on a PHP project, you always add the @ symbol before some code lines. do you know what it means? Next I will share with you the function pre-added at @ in PHP.
I used it today. just remember it. In fact, it is an error control character. even if an error occurs, it ignores the error message and continues to execute the following code.
The code is as follows:
@ $ Page = $ _ GET ['Page']? Intval ($ _ GET ['Page']): 1;
This is the value of the page keyword obtained from the URL, such"Index. php? Page = 5 ",Then $ page will get 5.
But if there is an error, such"Index. php"There is no page keyword.$ _ GET ['Page']If it does not exist, an error is reported. if @ exists, you can ignore this small error.
For example:
The code is as follows:
$ Conn = mysqli_conncet ("q", "w", "e", "r ");
In this case, an error message is entered about database connection.
The code is as follows:
@ $ Conn = mysqli_conncet ("q", "w", "e", "r ");
If @ is added before $ conn, the error message will not be output.
Remember here.
The above is the function of adding at @ in front of PHP. I hope you will like it.
Http://www.bkjia.com/PHPjc/1041334.htmlwww.bkjia.comtruehttp://www.bkjia.com/PHPjc/1041334.htmlTechArticlePHP plus at match @ parsing, phpat everyone in the PHP project, always some code line before the @ symbol, everyone knows what it means? I will share with you the functions in PHP...