HTML entity decode/XML

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
rossmurphy
Forum Newbie
Posts: 5
Joined: Thu Jun 11, 2009 10:33 am

HTML entity decode/XML

Post by rossmurphy »

Hi

I have this returned from a DB:

Code: Select all

<?xml version="1.0" encoding="UTF-8"?>&#10;<form 
                action="http://<serverip>/ecomgateway/PaymentProcessor" 
                method="post" name="form1">&#10;
I want to be able to set it in a var and use it like xml.

Code: Select all

$var->form['action']
Any ideas?
User avatar
andyhoneycutt
Forum Contributor
Posts: 468
Joined: Wed Aug 27, 2008 10:02 am
Location: Idaho Falls

Re: HTML entity decode/XML

Post by andyhoneycutt »

I'm not entirely sure what you're asking, but if you have that coming from a database, and you're spitting it to the page or something, instead of spitting it to the page just set it to be the value of that variable... I'm probably missing something, though. Your post is a bit ambiguous.

-Andyy
johniem
Forum Commoner
Posts: 29
Joined: Mon Jul 20, 2009 8:58 am

Re: HTML entity decode/XML

Post by johniem »

The result you posted has html entities encoded...to remove them you can use

Code: Select all

$decoded_string = html_entity_decode($encoded_string);
So now you must have this

Code: Select all

 
<?xml version="1.0" encoding="UTF-8"?>
<form action="http://<serverip>/ecomgateway/PaymentProcessor" method="post" name="form1">
 
and use it in whatever you want..

If there is something else that you want to do please be more specific..
Post Reply