PHP Questions Home | Register | Login
Categories
Arrays
Files
Forms
Creating PDFs
PHP Errors
Functions
Images
MySQL
Numbers
Others
Strings
Website
Unanswered

PHP Forums
Forums Index
MySQL Forum
PHP Forum
Flash/Actionscript
Javascript
Web design

More PHP
PHP Functions
Top Questions
Ask a Question
PHP Interview Questions
PHP Jobs
Ecommerce
IT Questions
Business Websites

Sponsors

sponsor ad
My Salary
PHP Developer Salary
Advertise Here

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



Comment on this Question and Answer >>>

ASK A QUESTION

More strings PHP Questions

What is the usage of { } in string handling in php?

how to compare strings in PHP?

How do you check if a variable is set or not in PHP?

How do I reverse a string in PHP?

How can I repeat a string variable several times?



Custom Search