Differences between three string delimiters in PHP

Source: Internet
Author: User
The difference between the three string delimiters in PHP is single quotation marks and double quotation marks. < <The differences are as follows: <p>

Single quotes: variables contained in single quotes are not parsed, but output as is.

For example, $ book = 'computer ';

$ StrTitle = 'This is $ Book'; // The output is This is $ book.

Double quotation marks: PHP parses variables contained in double quotation marks.

For example, $ book = "Computer ";

$ StrTitle = "This is $ book"; // The output is This is Computer

<: It is mainly used for some large text content. if there are defined variables in the middle, PHP will parse them.

To < <Add any name that you like, as shown in <

For example:

Echo <

Www.mssqw.com is a professional website construction and promotion network company that provides you with a full range of network services.

HEREDOC;

?>

Based on the above, we can see that the efficiency of single quotes is higher than that of the last two. Therefore, the use process should be determined as appropriate.

Type = "text/javascript"> AjaxAction ("/Ajax. Asp? Action = ShowSpecial & LogID = 33 & ShowType = 1 ");

The above is the difference between the three string delimiters in PHP. For more articles, please follow the PHP Chinese network (www.php1.cn )!

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.