Reference variable problem in PHP string

Source: Internet
Author: User

The string reference variables in PHP are mainly different from the database operation strings.

1, normal string reference variable

A. The outer layer must quote double quotation marks

B. The variables in the string can be written as: $s or {$s}

2. Database operation strings (database operations directives)

A. String outer layer must use double quotation marks

B. Variables must be in curly braces {} (except when assigning string properties) such as:

650) this.width=650; "src=" Http://s5.51cto.com/wyfs02/M02/89/47/wKioL1gOyujQVl7fAAAzlIxZyXc241.png "title=" QQ picture 20161025105611.png "alt=" Wkiol1goyujqvl7faaazlixzyxc241.png "/>" C. The type of the corresponding data attribute is required when the required variable is assigned to a database property or as a logical operation:

650) this.width=650; "src=" Http://s3.51cto.com/wyfs02/M02/89/49/wKiom1gOy3Oy1c37AABBkoRs94s040.jpg "title=" Qq20161025105900.jpg "alt=" wkiom1goy3oy1c37aabbkors94s040.jpg "/> The attribute title,authordid,content in the database in the preceding code is a string, So the variable is to use single quotation mark ' {$title} ' or ' $title ', the former is recommended

This article is from the "9043753" blog, please be sure to keep this source http://9053753.blog.51cto.com/9043753/1865324

Reference variable problem in PHP string

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.