Page 1 of 1

HTML entity decode/XML

Posted: Fri Jul 24, 2009 1:53 pm
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?

Re: HTML entity decode/XML

Posted: Fri Jul 24, 2009 2:21 pm
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

Re: HTML entity decode/XML

Posted: Fri Jul 24, 2009 2:29 pm
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..