Do you want to enclose $ _ GET and $ _ POST with quotation marks?

Source: Internet
Author: User
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 caseABAs a constant, that is:$ _ GET [constant AB]And$ _ POST [constant AB]The constant is not found in the context.ABAB is treated$ _ GETAnd$ _ 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.

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.