473,813 Members | 4,194 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

What does @ do?

I am new to php and google doesn't allow for searching on the @
symbol.

I have a script with the following line:

if (@$type_toggle || @cat_toggle) {
do_query....... .

What does the @ do? Can you give me a link so I can read about it.

Thanks!

Oct 24 '07 #1
4 6938
trading_jacks <MA**********@g mail.comwrote in
news:11******** **************@ k35g2000prh.goo glegroups.com:
I am new to php and google doesn't allow for searching on the @
symbol.

I have a script with the following line:

if (@$type_toggle || @cat_toggle) {
do_query....... .

What does the @ do? Can you give me a link so I can read about it.
it surpresses error messages, so that if the variable "$type_togg le" or
"$cat_toggl e" doesn't exist, error messages/warnings will not be printed to
the screen.
Oct 24 '07 #2
Good Man <he***@letsgo.c omwrote in
news:Xn******** *************** *@216.196.97.13 1:
trading_jacks <MA**********@g mail.comwrote in
news:11******** **************@ k35g2000prh.goo glegroups.com:
>I am new to php and google doesn't allow for searching on the @
symbol.

I have a script with the following line:

if (@$type_toggle || @cat_toggle) {
do_query...... ..

What does the @ do? Can you give me a link so I can read about it.

it surpresses error messages, so that if the variable "$type_togg le"
or "$cat_toggl e" doesn't exist, error messages/warnings will not be
printed to the screen.
and by the way, in relation to the "register_globa ls" questions that have
gone around the last couple of days, the script above is a perfect example
of why register_global s should be turned off.

if register_global s is on, simply checking for a variable will ALWAYS
return true, so in the code above, $type_toggle and $cat_toggle BOTH exist
and the query will ALWAYS be performed.

Oct 24 '07 #3
Greetings, Good Man.
In reply to Your message dated Thursday, October 25, 2007, 01:36:44,
>>I am new to php and google doesn't allow for searching on the @
symbol.

I have a script with the following line:

if (@$type_toggle || @cat_toggle) {
do_query..... ...

What does the @ do? Can you give me a link so I can read about it.

it surpresses error messages, so that if the variable "$type_togg le"
or "$cat_toggl e" doesn't exist, error messages/warnings will not be
printed to the screen.
GMand by the way, in relation to the "register_globa ls" questions that have
GMgone around the last couple of days, the script above is a perfect example
GMof why register_global s should be turned off.

GMif register_global s is on, simply checking for a variable will ALWAYS
GMreturn true, so in the code above, $type_toggle and $cat_toggle BOTH exist
GMand the query will ALWAYS be performed.

Then, to avoid ambiguous comparison, use clarifying functions.

In the example showed above:

if(!empty(@$typ e_toggle) || !empty(@cat_tog gle))
{
do_query....... .

To make sure You have non-empty array $arr:

if(is_array($ar r) && count($arr))
{
do_something();
}

Notice: it is not enough to check for count($var) as far as ordinary variables
always return 1 == count($var), so, construction:
if(count($var))
{
foreach($var as ...)

Will end in "Supplied variable should be an array" in some cases.
--
Sincerely Yours, AnrDaemon <an*******@free mail.ru>

Oct 24 '07 #4
heres one:
http://docs.php.net/docs.php

Oct 25 '07 #5

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

699
34301
by: mike420 | last post by:
I think everyone who used Python will agree that its syntax is the best thing going for it. It is very readable and easy for everyone to learn. But, Python does not a have very good macro capabilities, unfortunately. I'd like to know if it may be possible to add a powerful macro system to Python, while keeping its amazing syntax, and if it could be possible to add Pythonistic syntax to Lisp or Scheme, while keeping all of the...
3
3008
by: Chris Cioffi | last post by:
I started writing this list because I wanted to have definite points to base a comparison on and as the starting point of writing something myself. After looking around, I think it would be a waste of time to start writing yet another IDE and so am now thinking in terms of new features/plug-ins for existing systems. Right now I mostly use Komodo Personal and it's pretty close to being what I want. They don't currently support plug-ins,...
65
5401
by: perseus | last post by:
I think that everyone who told me that my question is irrelevant, in particular Mr. David White, is being absolutely ridiculous. Obviously, most of you up here behave like the owners of the C++ language. A C++ interface installation IS ABOUT THE C++ LANGUAGE! The language does not possess the ability to handle even simple file directory manipulation. Those wise people that created it did not take care of it. So, BOOST is a portable...
125
14876
by: Sarah Tanembaum | last post by:
Beside its an opensource and supported by community, what's the fundamental differences between PostgreSQL and those high-price commercial database (and some are bloated such as Oracle) from software giant such as Microsoft SQL Server, Oracle, and Sybase? Is PostgreSQL reliable enough to be used for high-end commercial application? Thanks
3
29689
by: Jukka K. Korpela | last post by:
I have noticed that the meaning of visibility: collapse has been discussed on different forums, but with no consensus on what it really means. Besides, implementations differ. The specification says: "The 'visibility' property takes the value 'collapse' for row, row group, column, and column group elements. This value causes the entire row or column to be removed from the display, and the space normally taken up by the row or column to...
7
2694
by: Dan V. | last post by:
Situation: I have to connect with my Windows 2000 server using VS.NET 2003 and C# and connect to a remote Linux server at another company's office and query their XML file. Their file may be updated every hour or so. How can I do this easily? I would like to use secure communication even encryption if possible. I would query and insert locally only the newest records found in that XML file to an xml or MS access db.
44
4293
by: lester | last post by:
a pre-beginner's question: what is the pros and cons of .net, compared to ++ I am wondering what can I get if I continue to learn C# after I have learned C --> C++ --> C# ?? I think there must be many know the answer here. thanks
121
10205
by: typingcat | last post by:
First of all, I'm an Asian and I need to input Japanese, Korean and so on. I've tried many PHP IDEs today, but almost non of them supported Unicode (UTF-8) file. I've found that the only Unicode support IDEs are DreamWeaver 8 and Zend PHP Studio. DreamWeaver provides full support for Unicode. However, DreamWeaver is a web editor rather than a PHP IDE. It only supports basic IntelliSense (or code completion) and doesn't have anything...
13
5065
by: Jason Huang | last post by:
Hi, Would someone explain the following coding more detail for me? What's the ( ) for? CurrentText = (TextBox)e.Item.Cells.Controls; Thanks. Jason
669
26285
by: Xah Lee | last post by:
in March, i posted a essay “What is Expressiveness in a Computer Language”, archived at: http://xahlee.org/perl-python/what_is_expresiveness.html I was informed then that there is a academic paper written on this subject. On the Expressive Power of Programming Languages, by Matthias Felleisen, 1990. http://www.ccs.neu.edu/home/cobbe/pl-seminar-jr/notes/2003-sep-26/expressive-slides.pdf
0
9734
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, well explore What is ONU, What Is Router, ONU & Routers main usage, and What is the difference between ONU and Router. Lets take a closer look ! Part I. Meaning of...
0
9607
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
10665
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
10406
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
10420
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
9221
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development projectplanning, coding, testing, and deploymentwithout human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
0
5568
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
1
4358
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
3
3029
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.