Hello,

I'm trying to do something I thought would be very simple. I need to display a "degree" symbol as part of my PHP output, and I can't figure it out. I'm trying to use the ASCII &deg code. If I try:

echo °

I get an error. If I try:

echo "&deg";

I simply display &deg on the screen. What am I missing? How can I display a degree symbol?

Thanks!

I will give you one new idea.....:idea:

to show symbol degree....
Here are the fantastic steps...:icon_mrgreen:

1> on your key board you will see num lock key....
on num lock key....
2> wtite your php code....

<?php
echo "Its 20";
?>

3> press Alt + down arrow + 248 and leave it....

After this
Surprise.....for you...:icon_surprised:

4> You will see degree symbol...... :icon_smile:

<?php
echo "Its 20 °";
?>

How's the idea.....:icon_razz:

Why not do what is usually done in MS Word and make the letter o in superscript. So try the below code:

<?
echo "It is 20<sup>o</sup>C.";
?>
This question has already been answered. Start a new discussion instead.