3v4l.org

run code in 150+ php & hhvm versions
Bugs & Features
<?php $array = array( "Titel 1", "Bericht 1", "Link 1", "Titel 2", "Bericht 2", "Link 2", "Titel 3", "Bericht 3", "Link 3", "Titel 3", "Bericht 3", "Link 4", ); $i = 0; echo '<ul>'; foreach($array as $content) { echo (++$i % 3 === 0 ? "\n<li>" . $content . '</li>' : ''); } echo "\n</ul>";
Output for 4.3.0 - 7.1.0
<ul> <li>Link 1</li> <li>Link 2</li> <li>Link 3</li> <li>Link 4</li> </ul>