PHP & XML

Ye' old general discussion board. Basically, for everything that isn't covered elsewhere. Come here to shoot the breeze, shoot your mouth off, or whatever suits your fancy.
This forum is not for asking programming related questions.

Moderator: General Moderators

Post Reply
lawkarkit
Forum Newbie
Posts: 1
Joined: Tue Oct 05, 2010 12:04 pm

PHP & XML

Post by lawkarkit »

Hi

Im doing an application using PHP for a premium SMS project. the system will receive xml respond from another server.may i know how can i use php to receive the xml value and store it in database?

here is the flow of the system

1. user subscribe to service using mobile phone : type ON DEMO , send to 33766
2. once telco receive the subscribtion, telco will send some value back to my server in XML, below is what i get from them.

<?xml version='1.0' encoding='UTF-8'?>
<soapenv:Envelope xmlns:soapenv="http://www.w3.org/2003/05/soap-envelope">
<soapenv:Body>
<ns1:SmsMo xmlns:ns1="http://types.xsd.simulator.sdk.digi.com">
<ns1:service_id>
CPA_PURE_916
</ns1:service_id>
<ns1:source_mobtel>
0162323899
</ns1:source_mobtel>
<ns1:sub_id>
0dad9d8a-00ad-18b3-fee7-0f619013bcbe
</ns1:sub_id>
<ns1:keyword>
on+era</ns1:keyword>
<ns1:transaction_id>
8437857
</ns1:transaction_id>
<ns1:short_code_suffix_ind>
N
</ns1:short_code_suffix_ind>
<ns1:short_code_suffix>
916
</ns1:short_code_suffix>
<ns1:array_of_info />
<ns1:sms_contents>
<ns1:sms_content>
<ns1:content>
On era
</ns1:content>
<ns1:ucp_data_coding_id>
0
</ns1:ucp_data_coding_id>
<ns1:ucp_msg_class>
</ns1:ucp_msg_class>
<ns1:ucp_msg_type>
</ns1:ucp_msg_type>
</ns1:sms_content>
</ns1:sms_contents>
</ns1:SmsMo>
</soapenv:Body>
</soapenv:Envelope>


I need to get value from this XML using php so i can store it in mysql database.

Please help.
User avatar
yacahuma
Forum Regular
Posts: 870
Joined: Sun Jul 01, 2007 7:11 am

Re: PHP & XML

Post by yacahuma »

look at simplexml
Post Reply