A difficult way of writing, the veteran also needs to be timid for a while

Source: Internet
Author: User
A difficult way of writing, the veteran also needs to be timid about the problem of single quotes in double quotes
Prepare to write in the following format
Script
$ Morpic. = "nnd = nnd +''
Img1 = new Image ();
Img1.src = "/UploadFiles/20121116135815925.jpg ";
Url1 = new Image ();
Url1.src = "";";
?>
Script
The red part is intended to be written. of course it is wrong. I just threw it into double quotation marks. the single quotation marks and double quotation marks are not processed yet,
So how to deal with it? I tried to escape it.

The content in double quotation marks is
Nnd = nnd +''
Img1 = new Image ();
Img1.src = "/UploadFiles/20121116135815925.jpg ";
Url1 = new Image ();
Url1.src = "";


Reply to discussion (solution)

 $morpic .='nnd=nnd'+'';

You can use the delimiters.

$ Morpic = '';

$ Text = < Nnd = nnd +''
Img1 = new Image ();
Img1.src = "/UploadFiles/20121116135815925.jpg ";
Url1 = new Image ();
Url1.src = "";
EOD;

$ Morpic. = $ text;

$ Morpic. = "[color = #008000] nnd = nnd +''
Img1 = new Image ();
Img1.src = "/UploadFiles/20121116135815925.jpg ";
Url1 = new Image ();
Url1.src = ""; "; [/color]

You can use the delimiters.

$ Morpic = '';

$ Text = < Nnd = nnd +''
Img1 = new Image ();
Img1.src = "/UploadFiles/20121116135815925.jpg ";
Url1 = new Image ();
Url1.src = "";
EOD;

$ Morpic. = $ text;



I wrote as you said, but I still prompted an error. Is it wrong,
Below is what I wrote
$ Morpic. = "< Nnd = nnd +''
Img1 = new Image ();
Img1.src = "/UploadFiles/20121116135815925.jpg ";
Url1 = new Image ();
Url1.src = "";
EOD ;"

}
Echo $ morpic;

Another problem
How do I write variables in delimiters?
$ Text = < Nnd = nnd +''
Img1 = new Image ();
Img1.src = "'. $ smallpic .'";
Url1 = new Image ();
Url1.src = "";
EOD;
Why can't I write this?

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.