HTML character code to ASCII

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • lani@lani.co.za

    #1

    HTML character code to ASCII

    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?
  • Olaf Schinkel

    #2
    Re: HTML character code to ASCII

    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_dec ode ?

    Comment

    • Jerry Stuckle

      #3
      Re: HTML character code to ASCII

      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@attgl obal.net
      =============== ===

      Comment

      • Michael Fesser

        #4
        Re: HTML character code to ASCII

        ..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

        Comment

        Working...