How to display multiple images in custom field

Assuming we are viewing some king of single – post, page, custom post type etc.

<?php

$imgs_meta = get_post_meta( get_the_ID(), 'AP_post_image', true );
if ( '' != $imgs_meta ) {
  $imgs = explode( ',', $imgs_meta );

  foreach ( $imgs as $src )
    printf( '<img src="https://wordpress.stackexchange.com/questions/182602/%s" />', esc_url( $src ) );
}