How to display this text? in textarea, there must be a line feed format

Source: Internet
Author: User
How can we display this text? in textarea, we need a line feed format & lt; html & gt; & lt; body & gt; & lt; textarea & nbsp; id = "tx" & nbsp; rows = 50 & nbsp; cols = 200 & gt; & lt;/textarea & gt; & lt;/body & gt; & lt; /html: how to display this text, in textarea, there must be a line feed format






$val="1234
document(\'5678\')";
echo '《script》document.getElementById("web_editor_con2").value="'.$val.'"《script》';
?>

------ Best solution --------------------
$ Val = "1234 document (\ '000000 \')";
Isn't the above a string? Why not write this?
$ Val = '1234file ("5678 ")';
------ Other solutions --------------------
$ Val = "1234"
Document (\ '2014 \')";

~~~~ Of a br ~~~~
------ Other solutions --------------------
Simply put

1234
Document ('20140901 ')

To display such a statement in textarea, I will escape it. However, the error is mainly caused by double quotation marks.

.. Value = "\"\'"

It's okay to escape single quotes. the escape double quotes conflict with the outer double quotes.
------ Other solutions --------------------
Reference:
$ Val = "1234 document (\ '000000 \')";
Isn't the above a string? Why not write this?
$ Val = '1234file ("5678 ")';


It's hard to be here and cannot be changed.

1234
Document ('20140901 ')

The original output is in textarea and cannot be materialized ..

Just as if you have entered this paragraph in textrea, the minor sign is the minor sign, the single quotation mark is the single quotation mark, and the double quotation mark is the double quotation mark,

How ??
------ Other solutions --------------------


How to use Javascript

1234
Document ('20140901 ')

Output in textarea ???

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.