Re: Re: Counterpart to htmlentities function: unhtmlentities
| From: | Wez Furlong | Date: | Thu, 28 Feb 2002 18:42:43 +0000 |
| Subject: | Re: Re: Counterpart to htmlentities function: unhtmlentities | ||
| References: | 1 | Groups: | php.dev |
| Request: | Send a blank email to php-dev+get-80526@lists.php.net to get a copy of this message | ||
Well, if the general opinion is that there *should* be such a
function included in PHP, around a week or so ago I implemented
a version that uses the multiple charset aware tables that are
already in html.c.
But the voting was -0 (Derick) and +1 (Yasuo).
Personally, I'm +0 since I have written the code but never ever
needed to un-htmlentity a string in the last 2-3 years.
--Wez.
On 27/02/02, "Rasmus Lerdorf" <rasmus@lerdorf.ca> wrote:
> Reversing htmlentities is trivial. I don't think it needs a special
> function.
>
> Simply do:
>
> $trans = get_html_translation_table(HTML_ENTITIES);
> $trans = array_flip($trans);
> $data = strtr($data,$trans);
>
> -Rasmus
>
> On Tue, 26 Feb 2002, Brad Fisher wrote:
>
> >
> > I have looked at the following:
> > http://www.php.net/anoncvs.php
> > http://cvs.php.net/cvs.php
> >
> > I am rather new to CVS, so perhaps this is a stupid question... I don't see
> > the HEAD branch anywhere... Can I check it out through anon CVS or would I
> > need dev access? Or is this a reference to php4?
> >
> > Perhaps I am just not looking in the right place.
> >
> > -Brad
> >
> > Yasuo Ohgaki wrote:
> >
> > > Brad Fisher wrote:
> > > > Just another function I have found useful.. PHP has a htmlentities
> > > > function, but no unhtmlentities function to go the other direction.. (At
> > > > least not that I am aware of). So, here you go. Don't think this one
> > > > would perform nearly as quickly if it were done using regexps in PHP...
> > > > This function also has the added benefit of supporting entities like
> > > > which I don't believe would be supported by a naive regexp
> > > > approach.
> > > >
> > > > So if someone would like to include it, be my guest.
> > >
> > > Could you post unified diff against latest CVS? (HEAD branch)
> > >
> > > We should have patch submit guide line in www.php.net for these
> > > people who are willing to help project :)
> > >
> > > --
> > > Yasuo Ohgaki
> > >
> > > --
> > > PHP Development Mailing List
> > > <http://www.php.net/>
> > > To unsubscribe, visit: http://www.php.net/unsub.php
> >
> >
> >
> > --
> > PHP Development Mailing List <http://www.php.net/>
> > To unsubscribe, visit: http://www.php.net/unsub.php
> >
>
>
> --
> PHP Development Mailing List <http://www.php.net/>
> To unsubscribe, visit: http://www.php.net/unsub.php