3v4l.org

run code in 200+ php & hhvm versions
Bugs & Features
<?php $images = array( 'topic1' => array('29', '30', '31'), 'topic2' => array('40'), 'topic3' => array('06', '07', '08', '09', '10', '11', '12', '13', '14', '15', '16', '17', '18', '19'), 'topic4' => array('32') ); foreach($images as $what => $topic) { echo '<div class="what">' . $what . '</div>' . "\n"; foreach($topic as $key => $img) { echo '<img src="' . $img . '.png"/>' . "\n"; } }
Output for 4.3.0 - 7.2.0
<div class="what">topic1</div> <img src="29.png"/> <img src="30.png"/> <img src="31.png"/> <div class="what">topic2</div> <img src="40.png"/> <div class="what">topic3</div> <img src="06.png"/> <img src="07.png"/> <img src="08.png"/> <img src="09.png"/> <img src="10.png"/> <img src="11.png"/> <img src="12.png"/> <img src="13.png"/> <img src="14.png"/> <img src="15.png"/> <img src="16.png"/> <img src="17.png"/> <img src="18.png"/> <img src="19.png"/> <div class="what">topic4</div> <img src="32.png"/>