<?php $headerShown = false; // Pretend this is your while loop for($i = 0; $i <= 10; $i++){ // Pretend this is your condition if($i > 5){ if(!$headerShown){ echo '<h2>Header</header>', PHP_EOL; $headerShown = true; } echo $i, PHP_EOL; } }
You have javascript disabled. You will not be able to edit any code.