The difference between $_get and $_post and single and double quotes in PHP for super-global array variables

Source: Internet
Author: User

The 1,$_get is displayed in the Address bar in clear text, $_post is through the HTTP main request, the page can not see (through Firebug);

2,http does not specify $_get and $_post can submit data restrictions, $_get by the browser and Web server settings, $_post is also affected by the Web server and php.ini related settings, $_get generally submit data size not exceeding 2k;

3, from the set up to $_get generally used to obtain or query data and carry out parameters, $_post generally used to update, insert, delete data and carry out parameters, with $_post to submit data relative to $_get security is higher;

4,$_post can submit a large amount of data, but it is not unlimited, can submit file data, $_get cannot submit file data.


A, the single quotation mark and the double quotation mark distinguish the escape character to be different, the single quotation mark can escape "\ ', \ \", and the double quotation mark can escape "\", \\,\r\n,\t,\f,\v,\$ ";

b, the single quotation mark cannot parse the variable, the double quotation mark can parse the variable, for example:

<?php

$a = 12;

$str 1= ' This is $a ';//print the result as this is $a

$str 2= "INSERT INTO Test set a= ' $a '"; \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ a= ' 12 '

C, the speed of resolution is different, single quotes faster

The difference between $_get and $_post and single and double quotes in PHP for super-global array variables

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.