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

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 for michelleradu

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 developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.