title: How to get meta value in wp_attachment_metadata
body: <p>want to get wp_attachment_metadata in my own way. I want to get the file name :</p>
  
  <pre><code>a:5:{s:5:"width";i:500;s:6:"height";i:500;s:4:"file";s:25:"2016/08/sprite_1500ml.jpg";s:5:"sizes";a:5:{s:9:"thumbnail";a:4:{s:4:"file";s:25:"sprite_1500ml-150x150.jpg";s:5:"width";i:150;s:6:"height";i:150;s:9:"mime-type";s:10:"image/jpeg";}s:6:"medium";a:4:{s:4:"file";s:25:"sprite_1500ml-300x300.jpg";s:5:"width";i:300;s:6:"height";i:300;s:9:"mime-type";s:10:"image/jpeg";}s:14:"shop_thumbnail";a:4:{s:4:"file";s:25:"sprite_1500ml-180x180.jpg";s:5:"width";i:180;s:6:"height";i:180;s:9:"mime-type";s:10:"image/jpeg";}s:12:"shop_catalog";a:4:{s:4:"file";s:25:"sprite_1500ml-300x300.jpg";s:5:"width";i:300;s:6:"height";i:300;s:9:"mime-type";s:10:"image/jpeg";}s:11:"shop_single";a:4:{s:4:"file";s:25:"sprite_1500ml-400x400.jpg";s:5:"width";i:400;s:6:"height";i:400;s:9:"mime-type";s:10:"image/jpeg";}}s:10:"image_meta";a:12:{s:8:"aperture";s:1:"0";s:6:"credit";s:0:"";s:6:"camera";s:0:"";s:7:"caption";s:0:"";s:17:"created_timestamp";s:1:"0";s:9:"copyright";s:0:"";s:12:"focal_length";s:1:"0";s:3:"iso";s:1:"0";s:13:"shutter_speed";s:1:"0";s:5:"title";s:0:"";s:11:"orientation";s:1:"0";s:8:"keywords";a:0:{}}}
  </code></pre>
  
  <p>Well, I am stuck. I don’t know how to separate that array. Anyone knows how to separate that array in order I can get the file name (url file).</p>
  
  <p>my code now : </p>
  
  
  
  <pre class="lang-html prettyprint-override"><code>$command = $_GET['command'];
  switch ($command) {
      case 'list_product':
  
          $loop = new WP_Query( 
                  array(
                          'post_type'    =&gt; 'product'
                      )
                  ); 
          if( $loop-&gt;have_posts() ) :
  
              $data = array( "api_status" =&gt; 1, "api_message" =&gt; "success");
              $meta = array();
              while ( $loop-&gt;have_posts() ) : $loop-&gt;the_post();
                      $meta[] = array(
                          "id"            =&gt; get_the_ID(),
                          "post_name"     =&gt; get_the_title(),
                          "stock_status"  =&gt; get_post_meta( get_the_ID(), '_stock_status', true ),
                          "price"         =&gt; get_post_meta( get_the_ID(), '_price', true ),
                          "reguler_price" =&gt; get_post_meta( get_the_ID(), '_regular_price', true ),
                                                  "image"         =&gt; get_post_meta( get_the__ID(), '_wp_attachment_metadata', true ),
                      );
              endwhile;
          endif;
          echo  json_encode($meta);
          break;
  </code></pre>
  
  
  
  <p>i mean when i use : </p>
  
  <pre><code>"image"         =&gt; get_post_meta( get_the__ID(), '_wp_attachment_metadata', true ),
  </code></pre>
  
  <p>my result doesnt show anything</p>
  
  <p>what improvement in my code so its can work like what i want ? </p>