• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 260
  • Last Modified:

@ in php

<?php

// Load key from QueryString
$bCopy = true;
$x_id = @$_GET["id"];

WHAT IS @ IN THE CODE ABOVE
0
teera
Asked:
teera
  • 2
  • 2
5 Solutions
 
Raynard7Commented:
The @ supresses any error messages.
0
 
ch2Commented:
You can read more about this here. http://www.php.net/operators.errorcontrol
0
 
BrianGEFF719Commented:
You really dont need the @ in the context above. If "id" doesnt exist it will simply return a blank string.

0
 
Raynard7Commented:
You would be better however doing

if (isset($_GET["id"])){
    $x_id = $_GET["id"];
} else {
   // whatever error handling is required / setting x_id to a default value
}
0
 
ch2Commented:
Other way to check id:

$x_id = isset($_GET['id']) ? $_GET['id'] : 'DefaultValue';

0

Featured Post

Hire Technology Freelancers with Gigs

Work with freelancers specializing in everything from database administration to programming, who have proven themselves as experts in their field. Hire the best, collaborate easily, pay securely, and get projects done right.

  • 2
  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now