PHP Questions Home | Register | Login
Categories
Arrays
Files
Forms
Creating PDFs
PHP Errors
Functions
Images
MySQL
Numbers
Others
Strings
Website
Unanswered

PHP Forums
Forums Index
MySQL Forum
PHP Forum
Flash/Actionscript
Javascript
Web design

More PHP
PHP Functions
Top Questions
Ask a Question
PHP Interview Questions
PHP Jobs
Ecommerce
IT Questions
Business Websites

Sponsors

sponsor ad
My Salary
PHP Developer Salary
Advertise Here

What does the @ character do in PHP?


This is an error suppression character in PHP.

For instance, if we want to stop errors at runtime (for instance in a live environment rather than in development), then we can use this to suppress typical errors that might occur.

Let's say we try to reference a variable that does not exist, and see what happens:

<?php

echo "$empty";
//PHP Notice: Undefined variable: empty in ...

echo @"$empty";
//no error message output
?>



Comment on this Question and Answer >>>

ASK A QUESTION

More other PHP Questions

What is a constant in PHP?

I have lots of if else logic - is there another option?

How do I find the timestamp for a particular date?

how can i put the value 1 or 0 into checkbox if we checked then 1 otherwise 0?

How do I add comments to my PHP script?



Custom Search