title: PHP - converting XML to array in PHP - parsing a soap xml in php and storing it in database
body: <p>I want to convert a soap xml response and store it in a database. Here is the XML that I have. </p>
  
  <pre><code>&lt;ENV:Envelope xmlns:ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:ns1="http://example.com/soap/example"&gt;
     &lt;ENV:Body&gt;
        &lt;ns1:GetCentresResponse&gt;
           &lt;ExampleCentre&gt;
              &lt;ns1:Cent&gt;
                 &lt;ID&gt;200&lt;/ID&gt;
                 &lt;Name&gt;example2&lt;/Name&gt;
                 &lt;Code&gt;ex2&lt;/Code&gt;
                 &lt;Email&gt;example2@example2.com&lt;/Email&gt;
                 &lt;Address1&gt;example2, example2 &lt;/Address1&gt;
                 &lt;Address2&gt;example2, example2 &lt;/Address2&gt;
                 &lt;City&gt;example2&lt;/City&gt;
                 &lt;PostCode&gt;111111&lt;/PostCode&gt;
                 &lt;Telephone&gt;1111111111&lt;/Telephone&gt;
                 &lt;Location&gt;11.11,-11.11&lt;/Location&gt;
                 &lt;URL&gt;/example2/exam2/ex2&lt;/URL&gt;
              &lt;/ns1:Cent&gt;
           &lt;/ExampleCentre&gt;
        &lt;/ns1:GetCentresResponse&gt;
     &lt;/ENV:Body&gt;
  &lt;/ENV:Envelope&gt;
  </code></pre>
  
  <p>I get this soap response from the server. I want to convert this to a array and store it in database. What should I do? I know the answer might be pretty straight forward, but hey, am a newbie :D </p>
  
  <p>Would really appreciate any help I get. </p>
  
  <p>Thank you in anticipation. </p>
  
  <p>Regards</p>