Sunday, January 1, 2012

PHP Operator: The "@" sign

2 comments
Let's talk about this php operator and how to use it on your script
okay, the at sign (@) is a special php operator which can be used to supress or "hide" the error
that might occur on your script.

this is quite useful on PHP DOM, File Processing,,etc..

okay i will show you an example.





<?php
 // missing or destroyed file
 @readfile("file.php");
?>


take a look at it ^
The @ sign was appended before the readfile function. try to remove it and see what's the result.

The output might be like this warning:

Warning: readfile(file.php) [function.readfile]: failed to open stream: No such file or directory in /home/unggoy_ang_nagbabasa/public_html/test.php on line 2


But if you append it on function, the error(s) will be ignored.
Use this operator if necessary.


Post By : PinoyPhp

2 comments:

  1. I am hosting my website Free on QuotesFox.com
    Its providing
    10 GB space
    100 GB monthly bandwidth
    Free Sub Domain
    Unmetered MySQL space
    PHP + MySQL
    Cpanel full featured
    PhpMyAdmin
    Firewall Protection
    UPS Power Back-up/Back-up
    Hotlink Protection
    Forum support [ http://quotesfox.com/forums ]
    and most importantly no ads
    My website is working like a charm with a lot of monthly traffic.
    This is worth taking look.
    QuotesFox.com

    ReplyDelete
  2. HI why you are spamming here ?
    Spamming not allowed

    ReplyDelete