title: PHP Soap Request foreach
body: <p>I have a Souap Request and I do not know how I can go through all VoucherCodeItems with foreach.
  I tried this, but it dosn't work:</p>
  
  <pre><code>foreach($response-&gt;VoucherCodeCollection-&gt;VoucherCodeItem AS $key =&gt; $val) {
   echo "Feld $key hat den Wert: $val&lt;br&gt;";
  }
  </code></pre>
  
  <p>This is what i get when make a print like:</p>
  
  <pre><code>print_r($response); 
  </code></pre>
  
  <p>Result</p>
  
  <pre><code>stdClass Object
  (
      [TotalResults] =&gt; 2
      [VoucherCodeCollection] =&gt; stdClass Object
          (
              [VoucherCodeItem] =&gt; Array
                  (
                      [0] =&gt; stdClass Object
                          (
                              [Id] =&gt; 215523
                              [ProgramId] =&gt; 6767
                              [Code] =&gt; 
                              [Title] =&gt; Adventskalender
                              [Description] =&gt; Im Adventskalender
                          )
                      [1] =&gt; stdClass Object
                          (
                              [Id] =&gt; 215453
                              [ProgramId] =&gt; 8476
                              [Code] =&gt; 
                              [Title] =&gt; Wir schenken dir 15 EUR!!
                              [Description] =&gt; 
                          )
  
  
                  )
  
          )
  
  )
  </code></pre>