title: Wordpress get attachment image src using foreach
body: <p>Using wordpress <a href="https://codex.wordpress.org/Custom_Fields" rel="nofollow">get_post_meta</a> $key. I was able to output attachment image in single.php using <a href="https://codex.wordpress.org/Function_Reference/wp_get_attachment_image_src" rel="nofollow">Function Reference/wp get attachment image src</a> for single attachment id:</p>
  
  <pre><code>&lt;?php 
  $attachment_id = get_post_meta($post-&gt;ID, 'attachment-id', true); // attachment ID
  
  $image_attributes = wp_get_attachment_image_src( $attachment_id ); // returns an array
  if( $image_attributes ) {
  ?&gt; 
  &lt;img src="&lt;?php echo $image_attributes[0]; ?&gt;" width="&lt;?php echo $image_attributes[1]; ?&gt;" height="&lt;?php echo $image_attributes[2]; ?&gt;"&gt;
  &lt;?php } ?&gt;
  </code></pre>
  
  <p>Since I am coding image gallery, I intend to use <strong>php foreach function</strong> to html output multiple images html code replacing the single post_meta $key with multiple ids array like (55,32,34).
  I need help with the code required to restructure the output due to my lack of PHP knowledge.</p>