473,386 Members | 1,795 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,386 software developers and data experts.

html_entity_decode workaround for 4.1.x

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
2 3057
"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
"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 thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

0
by: lawrence | last post by:
Using the conversion to char sets described for these functions, is it possible to get a whole string into some charset? I'm trying to figure out a way to take invalid character sets from idiot...
10
by: Markus Ernst | last post by:
Hi I have a string such as Добро" that shows the cyrillic word "?????" in the browser. Now I played around with lots of examples and contributed functions in the manual...
1
by: sylvian stone | last post by:
Hi, I've been having problems encoding / decoding data, and can't seem to figure out where I am going wrong. I extract data from a mysql table with a line like: $object_name =...
1
by: klappnase | last post by:
Hello everyone, there have already been a couple of threads about IDLE's sometimes annoying disability to use special characters (in my case I would like to use for example german umlauts like...
0
by: Jonas Smithson | last post by:
<div style="position: relative;> <!-- I'm the parent --> blah blah blah <div style="position: absolute; bottom: 0;> <!-- I'm the child --> blah blah blah </div> </div> The bottom of the...
1
by: slyi | last post by:
Hi All, Does anyone use vml to force the printing of background-colors in IE clients? Regards, slyi eg: <html xmlns:v="urn:schemas-microsoft-com:vml" >
9
nathj
by: nathj | last post by:
Hi, As you can tell by the subject of this post I'm having a spot of bother with htmlentities() and html_entity_decode(). I have built/am building a web site that allows user feedback. When...
1
by: Sebarry | last post by:
Hi, I'm trying to read the results of a database query into an XML document but it's only read so far and stopping. The XML document is as follows: <?xml version="1.0" encoding="utf-8"?> ...
0
by: William Johnston | last post by:
Hi, A support technician proposed a workaround to black images created for thumbnails. The code to create a thumbnail is below: //passes results to Response.OutputStream private void...
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.