Re: Re: Counterpart to htmlentities function: unhtmlentities

From: Date: Wed, 27 Feb 2002 11:07:28 +0000
Subject: Re: Re: Counterpart to htmlentities function: unhtmlentities
References: 1  Groups: php.dev 
Request: Send a blank email to php-dev+get-80440@lists.php.net to get a copy of this message
Derick Rethans wrote:
Hello, I've to agree wtih Rasmus here, IMO it does not warrant a new function. Derick
Yeah, but I believe both of you are _not_ agaist for having this, right? Having reverse order conversion function is nice when it is possbile to write one even if it is relatively easy to write. IMO. We need to consider if reverse order conversion function can do more than simple reverse order conversion, though. If it's not transitive, it's not a good idea to have. (At least, there should be flag to control) -- Yasuo Ohgaki
On Tue, 26 Feb 2002, Rasmus Lerdorf 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 :)
_________________________________________________________ Do You Yahoo!? Get your free @yahoo.com address at http://mail.yahoo.com

« previous php.dev (#80440) next »