String connection problems

Source: Internet
Author: User
Tags php example
How to connect the following strings, for example, border & quot; & #039 ;. $ args [& #039; border & #039;]. & #039; & quot; why is a single quotation mark used in double quotation marks? Why do I still use "." To Connect? I don't understand how the value of $ str is connected. I don't know this string... how is the following string connected? What I don't quite understand is, for example, border = "'. $ args ['border']. '", why is a single quotation mark used in double quotes? Why do I still use "." To Connect? I don't understand how the value of $ str is connected. I don't know how this string is segmented.
Please explain

$ Str ='

How is the following string connected? What I don't quite understand is, for example, border = "'. $ args ['border'].'". Why is a single quotation mark used in double quotation marks? Why do I still use "." To Connect? I don't understand how the value of $ str is connected. I don't know how this string is segmented.
Please explain

$str = '
'; Reply content:
';

His answer is just like studying English in Chinese. He never learns English in the future. He just understands his own words. In fact, all his answers are Chinese-based ideas.

The subject does not understand this problem because he does not understand the parser. The subject needs to apply the parser's thinking.

The parser starts with the first simple reference and then enters the character string matching string. Therefore, all non-simple arguments encountered are counted as part of the string.

All the content of a single cited string is unrecoverable, including the entire cited string.

Therefore, the topic is totally different from the alternative method.

In fact, this case does not require String concatenation. You only need to use the PHP example to solve the problem:

Root Certificate\"Will be parsed", The reverse skew of the string plays the role of ambiguity, while the starting string of $ will be recognized as a variation, bringing its value.

$str = "

Opposite to @ skywalker_z.

";

This method is simple and easy to understand, can cultivate correct ideas, and can be used in practice, in this example, the correct method of learning PHP is used.

$ Str ='

This is a little careless --

In fact, I think it is better to replace single quotes ..

nohighlight$str = 【
】;

The content in the square brackets is the original single quotation marks, which are output as is and not parsed.
In addition, there is a problem with code highlighting. We recommend that you copy it to notepad.

It can be easily concluded that the concatenated string is:

For the sake of beauty, I intentionally removed the single quotation marks of the associated array and understood the meaning ~
In addition, there is no problem with highlighting ....

$str = '

I think this writing method is more straightforward!

';

You can understand it after writing it several times ~

1. Both single quotes and double quotes must be paired.
2. variables are not parsed in single quotes, so a. sign is used to connect strings.
3.html attribute values are enclosed in double quotation marks.

If you use another method, it may look better:


    ';$str = sprintf(    $str,    $args['border'],    $args['width'],    $args['row'],    $args['col'],    $args['bgcolor']);

It turns out that single quotes contain double quotation marks.
Variables in single quotes will not be parsed, so they must be connected with dots,
The value of the html attribute must be enclosed in quotation marks, but the single quotation marks cannot be nested in the single quotation marks, so double quotation marks are used.

It is actually a single quotation mark and double quotation mark problem.

I am very grateful to you for your answers.
Repeat every bit of the vertex.

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.