An example of PHP @ at sign action, at example _php Tutorial

Source: Internet
Author: User
Tags at sign

An example of the role of PHP @ at notation, at example


Look at the PHP code, there are always some lines in front of the @ symbol, always do not know what the meaning. For example dede5.7 @ni =imagecreatetruecolor (Ftow, $ftoH);

If you use it today, just remember it. In fact, it is the error control, that is, even if an error occurs, ignore the error message, continue to execute the code below.

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

This is the value from the URL to get the page keyword, such as "index.php?page=5", then the $page will be taken to 5.

But if there is an error, such as "index.php" after the page keyword, if you go to fetch $_get[' page ' does not exist will be an error, then there is @ can ignore this small error.

Another example:

$conn = Mysqli_conncet ("Q", "W", "E", "R");

This will enter an error message about connecting to the database.

If the $conn is preceded by the @, you can not let him output the error message.

@ $conn = Mysqli_conncet ("Q", "W", "E", "R");

Here's a little bit of a note.


PHP Tagging issues

Short_open_tag = On
That's right. You need to remove the semicolon at the beginning of the line. The semicolon means, "this line is a comment, it doesn't work."
How can not output Apcha all have the boot path set all right
If you use it, you can output
Of course it is. If your short mark is not open, then only the content will be displayed.
Remember to use

The role of this symbol ^ in PHP and how to use it

^ is a starting match tag in PHP regular

$preg = '/^a/';//matches a character starting with a

http://www.bkjia.com/PHPjc/891102.html www.bkjia.com true http://www.bkjia.com/PHPjc/891102.html techarticle php @ at the sign of the role of the example, at the sample look at PHP code, there are always some lines in front of the @ symbol, has not known what the meaning. 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.