Monday 20 November 2017

operators - What is the use of the @ symbol in PHP?

itemprop="text">

I have seen uses of
@ in front of certain functions, like the
following:



$fileHandle =
@fopen($fileName,
$writeAttributes);



What
is the use of this symbol?


itemprop="text">
class="normal">Answer



It
suppresses error messages — see href="http://php.net/manual/language.operators.errorcontrol.php"
rel="noreferrer">Error Control Operators in the PHP
manual.


No comments:

Post a Comment

php - file_get_contents shows unexpected output while reading a file

I want to output an inline jpg image as a base64 encoded string, however when I do this : $contents = file_get_contents($filename); print &q...