I'm using the following code to show images in an ACF Gallery field
<?php $images = get_field('gallery'); if( $images ): ?> <?php foreach( $images as $image ): ?> <figure class="wp-caption aligncenter"> <img class="b-lazy" src="<?php echo get_template_directory_uri(); ?>/assets/images/spinner.gif" data-src="<?php echo $image['sizes']['featured-720']; ?>" alt="<?php the_title();?>"> </figure> <?php endforeach; ?> <?php endif; ?>
What i would like to do is to check for each $image, if there is another attached image with the same filename but different file extension (png).
There is an image attached called "ThisTitle.jpg" and I want to check if there is also another image attached called "ThisTitle.png"
I hope this make sense :)