title: How to convert SOAP response to PHP Array?
body: <p>I am unable to convert SOAP response to Array in php.</p>
  
  <p>here is the code</p>
  
  <pre><code> $response = $client-&gt;__doRequest($xmlRequest,$location,$action,1);
  </code></pre>
  
  <p>here is the SOAP response.</p>
  
  <pre><code>&lt;soap:envelope xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/"&gt;
  &lt;soap:body&gt;
  &lt;searchflightavailability33response xmlns="http://FpwebBox.Fareportal.com/Gateway.asmx"&gt;
  &lt;searchflightavailability33result&gt;
      &amp;lt;Fareportal&amp;gt;&amp;lt;FpSearch_AirLowFaresRS&amp;gt;&amp;lt;CntKey&amp;gt;1777f5a7-7824-46ce-a0f8-33d5e6e96816&amp;lt;/CntKey&amp;gt;&amp;lt;Currency CurrencyCode="USD"/&amp;gt;&amp;lt;OriginDestinationOptions&amp;gt;&amp;lt;OutBoundOptions&amp;gt;&amp;lt;OutBoundOption segmentid="9W7008V21Feb14"&amp;gt;&amp;lt;FlightSegment etc....
      &lt;/searchflightavailability33result&gt;
  &lt;/searchflightavailability33response&gt;
  &lt;/soap:body&gt;
  &lt;/soap:envelope&gt;;
  </code></pre>
  
  <p>i used the following ways to convert to Array,but i am getting empty output.</p>
  
  <pre><code>1.echo '&lt;pre&gt;';print_r($client__getLastResponse());
  2.echo '&lt;pre&gt;';print_r($response-&gt;envelope-&gt;body-&gt;searchflightavailability33response);
  3.echo '&lt;pre&gt;';print_r($client-&gt;SearchFlightAvailability33($response));
       4.simplexml_load_string($response,NULL,NULL,"http://schemas.xmlsoap.org/soap/envelope/");  
  
  5.echo '&lt;pre&gt;';print_r($client-&gt;SearchFlightAvailability33($response));
  </code></pre>
  
  <p>please advice me.</p>