Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Displaying degree symbol on webpage

Tags:

php

symbols

I have a program which extracts GPS coordinates from metadata and imports the results onto a database. I then display the data using PHP on a webpage.

My problem - I've recently created a new template but for whatever reason, it is no longer showing the degrees symbol '°' but a '�'.

I just find it strange that it works with one template, but not the other?

I've tried changing fonts, but had no luck

like image 647
Steven Mclaren Avatar asked Jan 22 '13 21:01

Steven Mclaren


People also ask

How do you make a degree symbol on a website?

Insert the degree symbol by using a keyboard shortcutOn your keyboard, press Alt + 0176.


2 Answers

See DEGREE CHARACTER.

Specifically, HTML Entity: °.

Check that you have the proper docstring and character encoding in both templates to make sure they are correct.

like image 54
Adrian Larson Avatar answered Oct 25 '22 12:10

Adrian Larson


You can use:

utf8_encode('YOUR TEXT');

utf8_encode converts the string data from the ISO-8859-1 encoding to UTF-8.

like image 27
Mukesh Chapagain Avatar answered Oct 25 '22 12:10

Mukesh Chapagain