php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Request #15535 Un-HTML-Entities
Submitted: 2002-02-13 05:35 UTC Modified: 2002-04-17 03:52 UTC
Votes:2
Avg. Score:4.5 ± 0.5
Reproduced:2 of 2 (100.0%)
Same Version:2 (100.0%)
Same OS:0 (0.0%)
From: klonx at gmx dot net Assigned:
Status: Closed Package: Feature/Change Request
PHP Version: 4.1.1 OS: Win2000
Private report: No CVE-ID: None
 [2002-02-13 05:35 UTC] klonx at gmx dot net
Hello PHP-Team, 

Some People wrote about that already, 
and they submitted some kind of work-arounds. 

My Feature-Request is about the function 
"htmlentities()" and "htmlspecialchars()" 

Well, i think a lot of people would appreciate 
if you would integrate functions like 
"UNhtmlentities" and "UNhtmlspecialchars" 
which would convert 'htmlspecialcharacterized' 
strings back to their original values. 

Regards, 
Maximilian

Patches

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2002-02-13 06:51 UTC] wez@php.net
I will look into it.
I'm not sure about the name though.
html_entity_decode($string) ?
--Wez.
 [2002-02-13 06:54 UTC] derick@php.net
I'm closing this, because you can do this:

$trans = get_html_translation_table(HTML_ENTITIES);

$str = "Hallo & <Frau> & Krämer"

$original = strtr($str, $trans);


IMO, this does not warrant a new function.
See also: http://www.php.net/manual/en/function.get-html-translation-table.php


Derick
 [2002-04-17 01:02 UTC] klonx at gmx dot net
I didn't get what i want with Derick's idea.

My original String was: Schlenger & Meilhamer

and after the procedure with:

$trans = get_html_translation_table(HTML_ENTITIES);

$str = "Schlenger & Meilhamer";

echo strtr($str, $trans);

This is what i get: Schlenger & Meilhamer

what i wanted to get: Schlenger & Meilhamer


So, This does not work like i want it to.

Regards, 
Maximilian
 [2002-04-17 01:08 UTC] klonx at gmx dot net
Sorry i didn't know where to post first, 
My Comment is ^above^ !
 [2002-04-17 01:13 UTC] cynic@php.net
Go read the get_html_translation_table() manual page.


 [2002-04-17 01:15 UTC] cynic@php.net
Although... I don't see why there shouldn't be unhtmlentities() or whatever.

 [2002-04-17 01:30 UTC] klonx at gmx dot net
Thanx, 

In the meantime i found it. 
But i had to write my own function to 
access the translation easier.
 [2002-04-17 03:52 UTC] wez@php.net
html_entity_decode is in CVS HEAD.
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Fri Aug 16 05:01:30 2024 UTC