3v4l.org

run code in 150+ php & hhvm versions
Bugs & Features
<?php $labels = array("Element1", "Element2", "Element3", "Element4", "Element5","Element6"); $key = 1; foreach($labels as $value) { if($key%2) { echo $value.","; } else { echo $value.",</br>"; } $key++; } ?>
Output for 4.3.0 - 5.6.28, hhvm-3.10.0 - 3.12.0, 7.0.0 - 7.1.0
Element1,Element2,</br>Element3,Element4,</br>Element5,Element6,</br>