title: assigning SOAP value to a variable
body: <p>I am trying to extract, for example, ServiceType from this SOAP call. In the below example, it is showing FTTN</p>
  <pre><code>if (VocusDevController::login()) {
  
              $client = new SoapClient('wsdl/VocusSchemas/WholesaleServiceManagement.wsdl', array(
                  'trace' =&gt; 1,
                  'exception' =&gt; true
              ));
          
              try {
          
                  $response = $client-&gt;Get(array(
                      &quot;AccessKey&quot; =&gt; &quot;SOMEKEY&quot;, 
                      &quot;ProductID&quot; =&gt; &quot;FIBRE&quot;,
                      &quot;Scope&quot; =&gt; &quot;QUALIFY&quot;,
                      &quot;Parameters&quot; =&gt; array('Param' =&gt; array('_' =&gt; 'LOC000023125730', 'id' =&gt; 'DirectoryID'))
                  ));
  
                  echo '&lt;pre&gt;';
                  print_r($response);
                  echo '&lt;/pre&gt;';
                  echo '&lt;hr&gt;';
                  // $output = $response-&gt;Parameters-&gt;Param-&gt;ServiceType; // This is where I am trying to extract ServiceType
              } catch (Exception $exception) {
                  echo 'Exception Thrown: ' . $exception-&gt;getMessage();
              }
          }
  </code></pre>
  <p>This is the output I get from the above call</p>
  <pre><code>stdClass Object
  (
      [TransactionID] =&gt; 17A935CDC7E1906
      [ResponseType] =&gt; SYNC
      [Parameters] =&gt; stdClass Object
          (
              [Param] =&gt; Array
                  (
                      [0] =&gt; stdClass Object
                          (
                              [_] =&gt; PASS
                              [id] =&gt; Result
                          )
  
                      [1] =&gt; stdClass Object
                          (
                              [_] =&gt; FTTN
                              [id] =&gt; ServiceType
                          )
  
                      [2] =&gt; stdClass Object
                          (
                              [_] =&gt; 13
                              [id] =&gt; ServiceClass
                          )
  
                      [3] =&gt; stdClass Object
                          (
                              [_] =&gt; Type 1
                              [id] =&gt; ConnectionType
                          )
  
                      [4] =&gt; stdClass Object
                          (
                              [_] =&gt; 20210910
                              [id] =&gt; CopperDisconnectionDate
                          )
  
                      [5] =&gt; stdClass Object
                          (
                              [_] =&gt; Urban
                              [id] =&gt; Zone
                          )
  
                      [6] =&gt; stdClass Object
                          (
                              [_] =&gt; FALSE
                              [id] =&gt; DevelopmentCharge
                          )
  
                      [7] =&gt; stdClass Object
                          (
                              [_] =&gt; CSA200000000332
                              [id] =&gt; CSA
                          )
  
                      [8] =&gt; stdClass Object
                          (
                              [_] =&gt; Auto-Assigned
                              [id] =&gt; CVCID
                          )
  
                      [9] =&gt; stdClass Object
                          (
                              [_] =&gt; CPI300009724591N/ALine In Use13N/AFALSE5Mbps,10Mbps,20Mbps33-3577-82TRUEFALSE
                              [id] =&gt; CopperPairRecord
                          )
  
                      [10] =&gt; stdClass Object
                          (
                              [_] =&gt; LOC000023125730NBNLOT: 18 1 CHILDS CCT BELROSE NSW
                              [id] =&gt; BroadbandAddressRecord
                          )
  
                  )
  
          )
  
  )
  </code></pre>
  <p>I am trying to extract ServiceType with <code>$output = $response-&gt;Parameters-&gt;Param-&gt;ServiceType;</code>, However, I just get this error:-</p>
  <pre><code>ErrorException
  Attempt to read property &quot;ServiceType&quot; on array
  </code></pre>
  <p>So, I am obviously trying to extract it incorrectly. Can someone shed some light on what I am doing wrong? Thanks</p>