PHP @ at Mark function, phpat Mark function _ PHP Tutorial

Source: Internet
Author: User
PHP @ at Mark and phpat mark. PHP @ at Mark function. phpat Mark function depends on the PHP code. some lines always have the @ symbol at the front of the line, and I don't know what it means. For example, dede5.7 @ $ niimagecreatetruecolor ($ ftoW, $ ftoH), PHP @ at, and phpat

Looking at PHP code, there is always a @ symbol on the front of some lines, and I don't know what it means. For example, dede5.7 @ $ ni = imagecreatetruecolor ($ ftoW, $ ftoH );

I used it today. just remember it. In fact, it is an error control character, that is, even if an error occurs, it ignores the error message and continues to execute the following code.

@$page=$_GET['page']?intval($_GET['page']):1;

This is the value of the page keyword obtained from the URL, such as "index. php? Page = 5 ", $ page will get 5.

However, if there is an error, such as "index. php "does not have the page keyword. if $ _ GET ['Page'] does not exist, an error is returned. if @ is returned, this small error can be ignored.

For example:

$conn = mysqli_conncet("q","w","e","r");

In this case, an error message is entered about database connection.

If @ is added before $ conn, the error message will not be output.

@$conn = mysqli_conncet("q","w","e","r");

Remember here.


Functions of php function addition & [at]

For reference.

[Php] Why is @ (at) added before some functions)

So that no error information is output to the page during function execution.

For example
Require (DISCUZ_ROOT. './forumdata/cache/cache_settings.php ');
If the cache_settings.php file cannot be found, an error will be reported.
However, if @ is added, no error will be reported.

Http://www.bkjia.com/PHPjc/890824.htmlwww.bkjia.comtruehttp://www.bkjia.com/PHPjc/890824.htmlTechArticlePHP @ at Mark function, phpat Mark function to see PHP code, always some line front side has @ symbol, never know what it means. For example, dede5.7 @ $ ni = imagecreatetruecolor ($ ftoW, $ ftoH )...

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.