473,801 Members | 2,328 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 3081
"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
7750
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
1851
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
1773
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
2182
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
4349
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
2134
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
9698
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
9556
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 effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
10516
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
10292
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
10262
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
9101
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
7589
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
5479
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...
3
2959
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.