Re: [PHP] Reversing htmlspecialchars()

2001-05-20 Thread ~~~i LeoNid ~~

On 19 May 2001 15:27:31 -0700 impersonator of [EMAIL PROTECTED]
(=?iso-8859-1?Q?Rudi_Benkovi=E8?=) planted &I saw in php.general:

>   function un_htmlentities($str) {
>   $trans = get_html_translation_table (HTML_ENTITIES);
>   $trans = array_flip ($trans);
>
or for earlier php versions, that do not support array_flip()

$trans=get_html_translation_table(HTML_ENTITIES);
reset($trans); 
while(list($key,$value)=each($trans)){
  $transs[$value]=$key;
}
$trans = &$transs;

>   $str = strtr ($str, $trans);
>   
>   return ($str);
>   }
>
>> -Original Message-
>> From: Jeroen Geusebroek [mailto:[EMAIL PROTECTED]]
>> Sent: Saturday, May 19, 2001 11:46 PM
>> To: [EMAIL PROTECTED]
>> Subject: [PHP] Reversing htmlspecialchars()
>> 
>> 
>> Hi There,
>> 
>> How can i reverse the htmlspecialchars() functions?
>> I can't seem to find a function for that.
>> 
>> Thanks,
>> 
>> Jeroen Geusebroek
>> 
>> -- 
>> PHP General 

^^^
--
LeoN to  e-mail: cut  "auto_no." if present. 
(.±.)  ` to think - is to speak quietly,  to speak - is to think aloud`
 \~/ 
My posted articles archive: http://leo.portland.co.uk/doc00.htm

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




RE: [PHP] Reversing htmlspecialchars()

2001-05-19 Thread Rudi Benkoviè

function un_htmlentities($str) {
$trans = get_html_translation_table (HTML_ENTITIES);
$trans = array_flip ($trans);

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

return ($str);
}

> -Original Message-
> From: Jeroen Geusebroek [mailto:[EMAIL PROTECTED]]
> Sent: Saturday, May 19, 2001 11:46 PM
> To: [EMAIL PROTECTED]
> Subject: [PHP] Reversing htmlspecialchars()
> 
> 
> Hi There,
> 
> How can i reverse the htmlspecialchars() functions?
> I can't seem to find a function for that.
> 
> Thanks,
> 
> Jeroen Geusebroek
> 
> -- 
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
> To contact the list administrators, e-mail: [EMAIL PROTECTED]
> 

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




Re: [PHP] Reversing htmlspecialchars()

2001-05-19 Thread jeroen

> > How can i reverse the htmlspecialchars() functions?
> > I can't seem to find a function for that.
>
> There is no function to do that.

Can't you use the translation array, reverse it, and apply it?
It's mentioned in the manual somewhere...

Would be heavy hack, but IMO it should work...

Jeroen



-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




RE: [PHP] Reversing htmlspecialchars()

2001-05-19 Thread Jeroen Geusebroek

Hi Rasmus,

> > How can i reverse the htmlspecialchars() functions?
> > I can't seem to find a function for that.
> 
> There is no function to do that.

Maybe it would be a nice feature to add in PHP?
For the moment i'll just have to make my own version then :)

Thanks,

Jeroen

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




Re: [PHP] Reversing htmlspecialchars()

2001-05-19 Thread Rasmus Lerdorf

> How can i reverse the htmlspecialchars() functions?
> I can't seem to find a function for that.

There is no function to do that.

-Rasmus


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




Re: [PHP] Reversing htmlspecialchars()

2001-03-19 Thread Egon Schmid (@work)

Yev wrote:

> I encoded my HTML text via htmlspecialchars(), but now need to get the
> actual HTML.. I searched the docs, but couldn't find the reverse
> function.  How would I do this?

See also: htmlentities(), array_flip(), and get_translation_table().

-Egon

-- 
SIX Offene Systeme GmbH   ·Stuttgart  -  Berlin 
Sielminger Straße 63   ·D-70771 Leinfelden-Echterdingen
Fon +49 711 9909164 · Fax +49 711 9909199 http://www.six.de
Besuchen Sie uns auf der CeBIT 2001,  Halle 6,  Stand F62/4

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]