Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

An introduction to the function of adding at symbol @ before PHP

2025-02-24 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Development >

Share

Shulou(Shulou.com)06/03 Report--

PHP before adding the at symbol @ function of the relevant introduction, many novices are not very clear about this, in order to help you solve this problem, the following editor will explain for you in detail, people with this need can come to learn, I hope you can gain something.

The copy code is as follows:

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

This is to get the value of the page keyword from URL. For example, "index.php?page=5", $page will get 5.

But if there is an error, for example, there is no page keyword after "index.php", if the $_ GET ['page'] does not exist, an error will be reported, and @ can ignore this small error.

Another example is:

The copy code is as follows:

$conn = mysqli_conncet ("Q", "w", "e", "r")

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

The copy code is as follows:

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

If you precede $conn with @, you can prevent him from outputting error messages.

Is it helpful for you to read the above content? If you want to know more about the relevant knowledge or read more related articles, please follow the industry information channel, thank you for your support.

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Development

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report