By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
424,962 Members | 1,998 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 424,962 IT Pros & Developers. It's quick & easy.

html_entity_decode workaround for 4.1.x

P: n/a
Is there another function or a workaround to have same results of
html_entity_decode in php 4.1.x?

Thanks.

--
=======================================
HI-LAB the Social Technology
같같같같같같같같같같같같같같같같같같같
www.hi-lab.net
같같같같같같같같같같같같같같같같같같같
by cooperativa sociale l'Utopia a r.l.
=======================================

Jul 17 '05 #1
Share this Question
Share on Google+
2 Replies


P: n/a
"HI-Lab * the Social Technology" <in**@toglimi.hi-lab.net> wrote in message news:<bp**********@newsreader.mailgate.org>...
Is there another function or a workaround to have same results of
html_entity_decode in php 4.1.x?

Thanks.


Take a look at the online manual -

http://uk2.php.net/manual/en/functio...tion-table.php

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
Jul 17 '05 #2

P: n/a
"HI-Lab * the Social Technology" <in**@toglimi.hi-lab.net> wrote in message news:<bp**********@newsreader.mailgate.org>...
Is there another function or a workaround to have same results of
html_entity_decode in php 4.1.x?


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_exists('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_decode($string)
{
$string = strtr($string,
array_flip(get_html_translation_table(HTML_ENTITIE S)));
$string = preg_replace("/&#([0-9]+);/me", "chr('\\1')", $string);
return($string);
}/*---html_entity_decode()------*/
}/*---end of html_entity_decode fix----------*/

---
"One who mix sports and patriotism is a barbarian"
Email: rrjanbiah-at-Y!com
Jul 17 '05 #3

This discussion thread is closed

Replies have been disabled for this discussion.