title: How to convert XML SOAP response to php string
body: <p>One of my clients created a web service on SOAP:</p>
  
  <pre><code>    POST /TiendaOnLine.asmx HTTP/1.1
  Host: tiendawow.webvillanet.com
  Content-Type: text/xml; charset=utf-8
  Content-Length: length
  SOAPAction: "http://tiendawow.webvillanet.com/ObtenerExistencia"
  
  &lt;?xml version="1.0" encoding="utf-8"?&gt;
  &lt;soap:Envelope xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/"&gt;
    &lt;soap:Body&gt;
      &lt;ObtenerExistencia xmlns="http://tiendawow.webvillanet.com/"&gt;
        &lt;articulo&gt;string&lt;/articulo&gt;
        &lt;usuario&gt;string&lt;/usuario&gt;
        &lt;password&gt;string&lt;/password&gt;
      &lt;/ObtenerExistencia&gt;
    &lt;/soap:Body&gt;
  &lt;/soap:Envelope&gt;
  </code></pre>
  
  <p>Then I created a php file to consume the web service:</p>
  
  <pre><code>    &lt;?php
              $url="http://tiendawow.webvillanet.com/TiendaOnLine.asmx?WSDL";
              $parameters=array();
              $parameters['articulo']="code";
              $parameters['usuario']="user";
  $parameters['password']="pass";        
              $client = new SoapClient($url,$parameters);
              $result = $client-&gt;ObtenerExistencia($parameters);
              var_dump($result);
      ?&gt;
  </code></pre>
  
  <p>And I get an output like this:</p>
  
  <pre><code>object(stdClass)#2 (1) { ["ObtenerExistenciaResult"]=&gt; string(5) "11.00" } 
  </code></pre>
  
  <p>What I need is to be able to save only the 11.00 (or whatever the value is depending on the articulo) on to a variable for later use, like saving it on a database. ¿How can I do it?</p>