title: How to echo specific key value from an object into an array value?
body: <p>I am trying to create a multidimensional array using data from some other arrays and objects. This is my php code:</p>
  
  <pre><code>&lt;?php
  
      $items = $cck-&gt;getItems();
  
      $out = array();
      foreach( $items as $item ) {
          $out[] = array( 
                          "art_id" =&gt; $item-&gt;getValue('art_id'),
                          "art_title" =&gt; $item-&gt;getValue('art_title'),
                          "urun_resmi_fieldx" =&gt; $item-&gt;getValue('urun_resmi_fieldx')
  
                          );
       } 
       ?&gt;
      &lt;pre&gt;&lt;?php print_r($out); ?&gt;&lt;/pre&gt;
  </code></pre>
  
  <p>The output is:</p>
  
  <pre><code>Array
  (
      [0] =&gt; Array
          (
              [art_id] =&gt; 308
              [art_title] =&gt; 3D Katı Modelleme
              [urun_resmi_fieldx] =&gt; Array
                  (
                  )
  
          )
  
      [1] =&gt; Array
          (
              [art_id] =&gt; 311
              [art_title] =&gt; Dişli paslanmaz çelik kollektörler
              [urun_resmi_fieldx] =&gt; Array
                  (
                      [0] =&gt; stdClass Object
                          (
                              [value] =&gt; images/311/urun.jpg
                              [image_title] =&gt; urun.jpg
                              [image_alt] =&gt; urun.jpg
                          )
  
                      [1] =&gt; stdClass Object
                          (
                              [value] =&gt; images/311/slide-1.jpg
                              [image_title] =&gt; slide-1
                              [image_alt] =&gt; slide-1
                          )
  
                  )
  
          )
  
  )
  </code></pre>
  
  <p>I need to echo only value of [value] from the sddClass Objects for [urun_resmi_fieldx], I don't want to output [image_title] [image_alt] but I don't know how. When I try the code below I can get a specific row correctly but I don't know how many rows there will be.</p>
  
  <pre><code>"urun_resmi_fieldx" =&gt; $item-&gt;getValue('urun_resmi_fieldx')["0"]-&gt;value
  </code></pre>
  
  <p>This is the output I need:</p>
  
  <pre><code>Array
  (
      [0] =&gt; Array
          (
              [art_id] =&gt; 308
              [art_title] =&gt; 3D Katı Modelleme
              [urun_resmi_fieldx] =&gt; Array
                  (
                  )
  
          )
  
      [1] =&gt; Array
          (
              [art_id] =&gt; 311
              [art_title] =&gt; Dişli paslanmaz çelik kollektörler
              [urun_resmi_fieldx] =&gt; Array
                  (
                      [0] =&gt; stdClass Object
                          (
                              [value] =&gt; images/311/urun.jpg
                          )
  
                      [1] =&gt; stdClass Object
                          (
                              [value] =&gt; images/311/slide-1.jpg
                          )
  
                  )
  
          )
  
  )
  </code></pre>
  
  <p>My question is how I can loop this [value]s from sddClass Objects into array value.
  Thanks.</p>