How do I print the " in an echo statement?
<?php
echo "this will give a "parse error"";
?>
There are two ways around this. First you can simply enclose with single quotes instead.
The second option is to escape the quotes like this with a backslash:
<?php
echo "Relief at last, no dreaded \"parse errors\" in sight!";
?>
Comment on this Question and Answer >>>
ASK A QUESTION
More strings PHP Questions
how to compare strings in PHP?How do I count the number of words in my text?
How can I remove trailing space from a string?
How do I make sure a string is a certain length?
What is the usage of {} in strings?
