Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

What does the @ do before $_POST and $_GET PHP [duplicate]

Tags:

php

I"m looking at someone code and it has many

@$_GET[];
@$_POST[];

What does the @ do?

like image 469
Ahmad Khan Avatar asked Sep 04 '13 20:09

Ahmad Khan


People also ask

What is $_ GET [' page ']?

PHP $_GET is a PHP super global variable which is used to collect form data after submitting an HTML form with method="get". $_GET can also collect data sent in the URL. Assume we have an HTML page that contains a hyperlink with parameters: <html> <body>

How to retrieve post data in PHP?

The $_REQUEST variableThe PHP $_REQUEST variable can be used to get the result from form data sent with both the GET and POST methods. Try out following example by putting the source code in test. php script. Here $_PHP_SELF variable contains the name of self script in which it is being called.


1 Answers

@ in PHP suppresses any errors, and allows anything executed thereafter to silently fail (instead of output an error string (assuming show_errors=true)).

See the docs on error control operators for more information.

like image 114
Brad Christie Avatar answered Sep 18 '22 10:09

Brad Christie