3v4l.org

run code in 300+ PHP versions simultaneously
<?php $type = 'c'; $imagesDir = array('a' => 'a', 'b' => 'b'); $images = glob($imagesDir . $type . '*[TYPE].{jpg,jpeg,png,gif}', GLOB_BRACE); foreach($images as $image): ?> <li><a href="<?php echo str_replace('[TYPE]', 'F', $image); ?>"><img src="<?php echo str_replace('[TYPE]', 'T', $image); ?></a>" alt="" /></li> <?php endforeach; ?>

preferences:
42.09 ms | 402 KiB | 5 Q