473,819 Members | 4,373 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

html_entity_dec ode workaround for 4.1.x

Is there another function or a workaround to have same results of
html_entity_dec ode 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 3083
"HI-Lab * the Social Technology" <in**@toglimi.h i-lab.net> wrote in message news:<bp******* ***@newsreader. mailgate.org>.. .
Is there another function or a workaround to have same results of
html_entity_dec ode 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.h i-lab.net> wrote in message news:<bp******* ***@newsreader. mailgate.org>.. .
Is there another function or a workaround to have same results of
html_entity_dec ode 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_exis ts('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_dec ode($string)
{
$string = strtr($string,
array_flip(get_ html_translatio n_table(HTML_EN TITIES)));
$string = preg_replace("/&#([0-9]+);/me", "chr('\\1') ", $string);
return($string) ;
}/*---html_entity_dec ode()------*/
}/*---end of html_entity_dec ode 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
2065
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 users, and translate the string so that in the end I have a string that won't cause my XML to test invalid. html_entity_decode() htmlspecialchars() htmlentities()
10
7755
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 (html_entity_decode, strtr, convert_cyr_string ...) but was not able to decode these entities. As browsers displays them correctly on my PC and Mac
1
1854
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 = stripslashes(htmlspecialchars($row, ENT_QUOTES));
1
2571
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 "ä" etc.). I have made a workaround that *seems* to work, so I can at least store files in the editor that use such characters ( on the python shell I still get: UnicodeError: ASCII encoding error: ordinal not in range(128)
0
1774
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 child div lines up with the bottom of the parent div in Win IE6 and in Win NS6. However, Mac IE5 has a nasty bug -- it lines up the bottom of the child div with the *top of the body* -- I kid you
1
2184
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
4350
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 the user enters their review of a resource it is stored in the database. It goes into a LONGTEXT field and what is entered is passed through htmlentities(): $reviewToStore = htmlentities($reviewEntered, ENT_QUOTES) ; The results in the database...
1
2135
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"?> <night> <name>Poontang</name>
0
1439
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 CreateThumbnail(string url) { try
0
9752
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, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
10711
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, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
10435
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 tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
10463
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
10160
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
6911
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
5590
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
5725
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
4381
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system

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.