In this example, we have an array containing some data.
We capture the output buffer in $items_li_html and use it twice in the page.
<?php
// Start capturing the output
ob_start();
$items = ['Home', 'Blog', 'FAQ', 'Contact'];
foreach($items as $item):
// Note we're about to step &q...