Print string

From LemonWiki共筆
Jump to navigation Jump to search

Print the string spanning multiple lines

PHP[edit]

Using the Heredoc syntax[1] to print the string spanning multiple lines

<?php

echo <<<'EOD'
The quick brown fox jumps over the lazy dog
using nowdoc syntax. Backslashes are always treated literally,
e.g. \\ and \'.
EOD;

Python[edit]

Using triple quotes[2] to print the string spanning multiple lines

print("""The quick brown fox 
jumps over the lazy dog""")

Related pages[edit]

References[edit]