Hi,
I would like to know what are the different ways to print (echo) text & variables.
If using echo "", it's a pain to cancel all the double quotes; see examples. Using the single quotes can also get into conflict with text.
If I need to print a lot of text and variables what are the options aside from using echo <<<EOF etc...
In perl the following is clean and can output multiple lines of text and variables.
This way it doesn't get in conflict with single and double quotes in the text to print.
I'm new to php, so any tips and tricks would be appreciated.
I would like to know what are the different ways to print (echo) text & variables.
If using echo "", it's a pain to cancel all the double quotes; see examples. Using the single quotes can also get into conflict with text.
Code:
echo "<a href=\"[URL unfurl="true"]www.link.com\"[/URL] class=\"css_class\">Richy's site</a> \n";
If I need to print a lot of text and variables what are the options aside from using echo <<<EOF etc...
In perl the following is clean and can output multiple lines of text and variables.
Code:
print qq(
Some text here + $variable
Another line.
);
This way it doesn't get in conflict with single and double quotes in the text to print.
I'm new to php, so any tips and tricks would be appreciated.