What does the @ character do 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
How do I check if a date entered exists?How do you get an array of the date and time?
How do I find out about my PHP installation?
What is a constant in PHP?
How do I add comments to my PHP script?
