-1

My company has asked me to analyse backend code for one the live websites that our company maintains. I have run into a problem. I can't quite figure what '@' is doing here in this code if(@($_SESSION['user'])){...}

I looked everywhere what this means and haven't found anything even remotely resembling this. I hope someone on this forum can help me out. Below is the entire code snippet.

if(@($_SESSION['user']))
{
    $usrid=$_SESSION['user'];
    $getprflimg=$db->singlerec("select img from register where 
    id='$usrid'");                                                                                                                                                                                                                                                          
    $imgurlprl=$getprflimg['img'];
    if(file_exists($url))
        $imgurlprl=$siteurl."uploads/user_images/".$imgurlprl;
    else
        $imgurlprl=$siteurl."/uploads/user_images/no_image.png";
}
S.Alvi
  • 144
  • 1
  • 10

1 Answers1

1

@ before the variable is used to suppress the warning generated for that variable. This is also relevant to 'At' symbol before variable name in PHP: @$_POST.

Dhananjay Kyada
  • 1,015
  • 1
  • 6
  • 14