html_entity_decode workaround for 4.1.x

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • HI-Lab * the Social Technology

    html_entity_decode workaround for 4.1.x

    Is there another function or a workaround to have same results of
    html_entity_dec ode in php 4.1.x?

    Thanks.

    --
    =============== =============== =========
    HI-LAB the Social Technology
    °°°°°°°°°°°°°°° °°°°°°°°°°°°°°° °°°°°°°°°

    °°°°°°°°°°°°°°° °°°°°°°°°°°°°°° °°°°°°°°°
    by cooperativa sociale l'Utopia a r.l.
    =============== =============== =========

  • Ron Barnett

    #2
    Re: html_entity_dec ode workaround for 4.1.x

    "HI-Lab * the Social Technology" <info@toglimi.h i-lab.net> wrote in message news:<bpfgeh$5r o$1@newsreader. mailgate.org>.. .[color=blue]
    > Is there another function or a workaround to have same results of
    > html_entity_dec ode in php 4.1.x?
    >
    > Thanks.[/color]

    Take a look at the online manual -



    at the bottom of the page the example appears to go what you want,
    converting from the HTML entity form to the plain language form.

    Ron

    Comment

    • R. Rajesh Jeba Anbiah

      #3
      Re: html_entity_dec ode workaround for 4.1.x

      "HI-Lab * the Social Technology" <info@toglimi.h i-lab.net> wrote in message news:<bpfgeh$5r o$1@newsreader. mailgate.org>.. .[color=blue]
      > Is there another function or a workaround to have same results of
      > html_entity_dec ode in php 4.1.x?[/color]

      Once I've downloaded the following code from
      http://in.php.net/html_entity_decode But, they've deleted it now:-(
      Anyway, in that example itself they've given the workaround for <4.3.0
      (See, unhtmlentities ($string) on that page).

      if (!function_exis ts('html_entity _decode'))
      {
      //Fix for older versions (<4.3.0) of PHP
      //grabbed at http://www.php.net/manual/en/functio...ity-decode.php
      function html_entity_dec ode($string)
      {
      $string = strtr($string,
      array_flip(get_ html_translatio n_table(HTML_EN TITIES)));
      $string = preg_replace("/&#([0-9]+);/me", "chr('\\1') ", $string);
      return($string) ;
      }/*---html_entity_dec ode()------*/
      }/*---end of html_entity_dec ode fix----------*/

      ---
      "One who mix sports and patriotism is a barbarian"
      Email: rrjanbiah-at-Y!com

      Comment

      Working...