How can I use HTML symbols when printing HTML with PHP?
For example:
<?php
echo "<p>here is a symbol •</p>";
?>
The •
is an HTML symbol for bullet: http://www.w3schools.com/tags/ref_symbols.asp.
I currently see "here is a symbol &bull". I expect to see "here is a symbol •".
Your code doesn't look like it has problems at all. But there are a few things you can do:
&bull
, then you know you've got an error. Try rendering using single quotes or print <<<HERE HERE;
.The issue here is not this particular line of code you have provided. Likely this is a problem with your PHP environment. You may have and extension that automatically translates all html entities. PHP processing takes place on the server's side. HTML processing is done client side once your browser receives the code. This would mean that once PHP has done it's processing the resulting string is &bull
. You will need to look into your PHP configuration. One setting to check is default_mimetype
which should be 'text/html'.