Click here to get back home

HTML character code to ASCII

 HomeNewsGroups | Search | About
 comp.lang.php    Post an article   get this group's latest topics as an RSS feed add this group's latest topics to your My MSN content add this group's latest topics to your My Yahoo content
Subject Author Date
HTML character code to ASCII lani 06-23-2008
Posted by lani on June 23, 2008, 9:58 am
Please log in for more thread options
I have special characters in my DB in HTML format like " & # 2 3 3 ;
". In the HTML part of the site this is fine but if I expert data to
csv file it prints " & # 2 3 3 ; " and not the =E9 character. Is there
a PHP standard function to convert HTML character codes to ASCII
characters?

Posted by Olaf Schinkel on June 23, 2008, 10:10 am
Please log in for more thread options
lani@lani.co.za schrieb:
> I have special characters in my DB in HTML format like " & # 2 3 3 ;
> ". In the HTML part of the site this is fine but if I expert data to
> csv file it prints " & # 2 3 3 ; " and not the é character. Is there
> a PHP standard function to convert HTML character codes to ASCII
> characters?
html_entity_decode ?

Posted by Jerry Stuckle on June 23, 2008, 11:16 am
Please log in for more thread options
lani@lani.co.za wrote:
> I have special characters in my DB in HTML format like " & # 2 3 3 ;
> ". In the HTML part of the site this is fine but if I expert data to
> csv file it prints " & # 2 3 3 ; " and not the é character. Is there
> a PHP standard function to convert HTML character codes to ASCII
> characters?
>

Why are you storing characters in your DB in HTML format? You should be
storing them as regular data - and if you need HTML for a display,
convert after retrieving.

--
==================
Remove the "x" from my email address
Jerry Stuckle
JDS Computer Training Corp.
jstucklex@attglobal.net
==================


Posted by Michael Fesser on June 24, 2008, 2:28 am
Please log in for more thread options
.oO(lani@lani.co.za)

>I have special characters in my DB in HTML format like " & # 2 3 3 ;
>". In the HTML part of the site this is fine but if I expert data to
>csv file it prints " & # 2 3 3 ; " and not the é character. Is there
>a PHP standard function to convert HTML character codes to ASCII
>characters?

Fix your DB instead and store the raw data, preferably in UTF-8.
Then you can print it out as-is to a CSV file, to HTML, whatever.

Micha

Similar ThreadsPosted
an idiot question: if ord() returns a value between 0 and 127, then the character is ASCII? August 18, 2005, 10:33 am
Warning: Unexpected character in input: " (ASCII=11) state=1 September 27, 2007, 4:45 pm
Parse HTML ASCII June 28, 2006, 9:25 am
character conversion from MS Word to HTML February 19, 2007, 1:55 pm
html special character in the when submit form August 24, 2006, 4:14 am
Html-encode all characters not in the current character set April 26, 2007, 8:23 am
embedded HTML in php code with 5.1.1 January 11, 2006, 8:32 pm
HTML code in eval March 9, 2006, 4:26 pm
Convert HTML Code to an Image February 11, 2005, 11:16 am
4.3.10 inserting code invalid HTML March 21, 2005, 12:07 pm

Our other projects:

Art Dolls, Fairies and Mermaids - Sunnyfaces.net

Roy's Linux, Programming and Search Engines messages

1-Script XML SitemapXML Sitemap