i am trying to print " in echo statement.
i can't get any method other than

<?php 
echo " " ";
?>

which is definitely wrong.
help me to find a way out of it.
any help is appreciated.

Recommended Answers

You need to escape the double quote with a backslash:

<?php
echo " \" ";
?>

Jump to Post

All 3 Replies

try using single qoute for the double quotes and double quoutes for the single quotes. Otherwise, yo can escape it. Another alternative is to use heredoc for a longer string., but for your situation something like this will do..
<?php
echo '"';
echo "' '";
?>

Member Avatar

You need to escape the double quote with a backslash:

<?php
echo " \" ";
?>

thanks for your response.
i will keep that in mindand use it in future.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of 1.21 million developers, IT pros, digital marketers, and technology enthusiasts learning and sharing knowledge.