Join the social network of Tech Nerds, increase skill rank, get work, manage projects...
 
  • What is the use of the @ symbol in PHP ?

    • 0
    • 1
    • 0
    • 0
    • 0
    • 0
    • 0
    • 0
    • 90
    Comment on it

    Hi Reader's,
    Welcome to FindNerd, today we are going to discuss what is the use of the @ symbol in PHP ?

    so basically @ symbol is an "Error Control Operators" and it's works only on expressions.
    In other word we can say that this symbol is used for hiding error message.

    let see in bellow example:

    Suppose you are not using the "@" operator then your code will look like this:

    $file = fopen($fileName, $attributes);
    

    But when you will open file it will show not found, and It will show an error message as you are not using @ operator/symbol.

    Now using "@" operator your code will look like:

    $file = @fopen($fileName, $attributes);
    

    when you will open file it will show not found, but It will not show any error message.

    So the difference is only that if you are not using @ operator the error message will appear and if you are using @ operator the error message will not appear

 0 Comment(s)

Sign In
                           OR                           
                           OR                           
Register

Sign up using

                           OR                           
Forgot Password
Fill out the form below and instructions to reset your password will be emailed to you:
Reset Password
Fill out the form below and reset your password: