Do you want to enclose $ _ GET and $ _ POST with quotation marks? Do you want to enclose $ _ GET and $ _ POST with quotation marks?
Reply content:
Do you want to enclose $ _ GET and $ _ POST with quotation marks?
You can also:$ _ GET [AB]
$ _ POST [AB]
However, in this caseAB
As a constant, that is:$ _ GET [constant AB]
And$ _ POST [constant AB]
The constant is not found in the context.AB
AB is treated$ _ GET
And$ _ POST
. Therefore, we recommend that you:$ _ GET ['AB']
$ _ POST ['AB']
Or$ _ GET ["AB"]
$ _ POST ["AB"]
However, in terms of performance,$ _ GET ['AB']
Better$ _ GET ["AB"]
,$ _ POST ['AB']
Better$ _ POST ["AB"]
, So the best solution is:$ _ GET ['AB']
$ _ POST ['AB']
.
To add.
It is best to enclose the key in quotation marks without constant parsing.
This is no different from the use of arrays, but it is recommended to add single quotation marks. As mentioned above, constant resolution is not implemented when quotation marks are added, and single quotation marks are recommended to avoid replacing variables in strings.