If I have a method def some_method p = {} string = <<-MY_TERMINATOR Example text blah blah lorem ipsum something or another
Is开发者_Python百科 there a convenient way to quote a large block of HTML that has both single and double quotes in JavaScript?
In python I can construct a HTML string without worrying about escaping special characters like < or \" by simply enclosing the string in triple quotes like:
I needed to write a script to enter multi-line input to a program (psql). After a bit of googling, I found the following syntax works:
I like the HEREDOC syntax, e.g. for edge cases of generated HTML that are not worth putting into a template.
Toying with heredocs in PHP, I realized the name of the heredoc does not have to be unique.Thus: $a = <<开发者_如何学Go;<EOD
What is the effect of the following code? $page = <<<CON <p><center>Blah blah blah</center></p>
I\'m trying to heredoc the following code: <?php //some php //some more php if (some condition) { ?>