Welcome! Log In Create A New Profile

Advanced

Special Characters - Getting Practical with PHP

Posted by 77911997 
Announcements Last Post
Announcement SoC Curricula 09/30/2017 01:08PM
Announcement Demarcation or scoping of examinations and assessment 02/13/2017 07:59AM
Announcement School of Computing Short Learning Programmes 11/24/2014 08:37AM
Announcement Unisa contact information 07/28/2011 01:28PM
Special Characters - Getting Practical with PHP
April 24, 2013 09:40AM
Hi Everybody, I need help.

This is not related to a portfolio... I am trying to display a £ (pound sign) from a database. I can see it on a database but when I display it in a PHP page it shows a funny character.

I have tried this:

Language: PHP
$price = htmlentities($pricerow[';price';]);

Language: PHP
$price = htmlspecialchars($pricerow[';price';]);

NB: on a database I have something like £1000000 but displays a funny character and a number.

any ideas how to go about doing this?
Re: Special Characters - Getting Practical with PHP
April 24, 2013 09:44AM
please note my Meta tag is set to UTF-8

Language: PHP
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
Re: Special Characters - Getting Practical with PHP
April 24, 2013 10:02AM
Nevermind - its sorted thumbs up smiley

I used SET NAMES utf8 right after my database connection.

Language: PHP
mysql_query("SET NAMES utf8");
Sorry, only registered users may post in this forum.

Click here to login