PHP Questions Home

Categories

Arrays
Files
Forms
Functions
Images
MySQL
Numbers
Others
Strings
Website


PHP Functions

PHP Functions


More PHP

Top Questions
Ask a Question

How do I print the " in an echo statement?


If you are printing content to the screen and you have a double quote in it, you will get a parse error:

<?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!";
?>



More strings PHP Questions

How do I add commas easily to a string of numbers?
How do I fetch the meta tags from a webpage using PHP?
How do I make sure a string is a certain length?
How do I display newline characters on a webpage?
How do I remove trailing whitespace?