472,977 Members | 2,018 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

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

html entities and ampersands

my php script gets delivered text that contains special chars (like
german umlauts), and these chars may, may partially or may not be
coverted into html entities already. i don't know beforhand.

question: how to spot wether an ampersand is just an ampersand and
needs to be converted or is part of an html entity and must be left
alone?

any help appreciated, micha

Jul 17 '05 #1
2 4942
micha wrote:
my php script gets delivered text that contains special chars (like
german umlauts), and these chars may, may partially or may not be
coverted into html entities already. i don't know beforhand.

question: how to spot wether an ampersand is just an ampersand and
needs to be converted or is part of an html entity and must be left
alone?

any help appreciated, micha


http://ch2.php.net/html_entity_decode

Have PHP decode the entities, the remaining ampersands should be just
ampersands.

--
Markus
Jul 17 '05 #2

Markus Ernst wrote:
micha wrote:
my php script gets delivered text that contains special chars (like
german umlauts), and these chars may, may partially or may not be
coverted into html entities already. i don't know beforhand.

question: how to spot wether an ampersand is just an ampersand and
needs to be converted or is part of an html entity and must be left
alone?

any help appreciated, micha
http://ch2.php.net/html_entity_decode

Have PHP decode the entities, the remaining ampersands should be just

ampersands.

--
Markus


yes, brilliant idea.
decode any present entities, than encode the whole thing again to get
any entity encoded (which is the aim, probably didn't become clear in
my 1st post).

micha

Jul 17 '05 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

11
by: yawnmoth | last post by:
say i have a for loop that would iterate through every character and put a space between every 80th one, in effect forcing word wrap to occur. this can be implemented easily using a regular...
6
by: Horst Gutmann | last post by:
Hi :-) I currently have quite a big problem with minidom and special chars (for example ü) in HTML. Let's say I have following input file:...
0
by: Tag | last post by:
Altova StyleVision has good features for generating hyperlinks with both static and dynamic segments. But I don't quite see how to create an anchor in the same document, so I can, for example,...
17
by: mickjames | last post by:
Hi, I'd like to include the whole web page content (as opposed to just the headlines) into RSS/XML to enable people to read them via rss feed readers. Question: how to convert HTML elements...
5
by: ion | last post by:
Hi! I'm trying to do the simplest thing in the world, that is --> replace all characters with entities I saw the clever use of a string-replace template at...
23
by: John | last post by:
Last year, I remember finding a web page describing how to pass the name of a file to another web page, and have that web page load that image file. Now, I can't find my record of that (it was...
7
by: ian ward | last post by:
Hello, I want to show the result of some JavaScript on an HTML page. I've had a look at some threads and it seems the conclusion is the following - javascript entities are usable on the...
6
by: clintonG | last post by:
Can anybody make sense of this crazy and inconsistent results? // IE7 Feed Reading View disabled displays this raw XML <?xml version="1.0" encoding="utf-8" ?> <!-- AT&T HTML entities & XML...
6
by: Clodoaldo | last post by:
I was looking for a function to transform a unicode string into htmlentities. Not only the usual html escaping thing but all characters. As I didn't find I wrote my own: # -*- coding: utf-8...
0
by: lllomh | last post by:
Define the method first this.state = { buttonBackgroundColor: 'green', isBlinking: false, // A new status is added to identify whether the button is blinking or not } autoStart=()=>{
2
by: DJRhino | last post by:
Was curious if anyone else was having this same issue or not.... I was just Up/Down graded to windows 11 and now my access combo boxes are not acting right. With win 10 I could start typing...
2
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 4 Oct 2023 starting at 18:00 UK time (6PM UTC+1) and finishing at about 19:15 (7.15PM) The start time is equivalent to 19:00 (7PM) in Central...
0
tracyyun
by: tracyyun | last post by:
Hello everyone, I have a question and would like some advice on network connectivity. I have one computer connected to my router via WiFi, but I have two other computers that I want to be able to...
2
by: giovanniandrean | last post by:
The energy model is structured as follows and uses excel sheets to give input data: 1-Utility.py contains all the functions needed to calculate the variables and other minor things (mentions...
4
NeoPa
by: NeoPa | last post by:
Hello everyone. I find myself stuck trying to find the VBA way to get Access to create a PDF of the currently-selected (and open) object (Form or Report). I know it can be done by selecting :...
3
NeoPa
by: NeoPa | last post by:
Introduction For this article I'll be using a very simple database which has Form (clsForm) & Report (clsReport) classes that simply handle making the calling Form invisible until the Form, or all...
1
by: Teri B | last post by:
Hi, I have created a sub-form Roles. In my course form the user selects the roles assigned to the course. 0ne-to-many. One course many roles. Then I created a report based on the Course form and...
4
by: GKJR | last post by:
Does anyone have a recommendation to build a standalone application to replace an Access database? I have my bookkeeping software I developed in Access that I would like to make available to other...

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.