<?php foreach ($data as $i => $row): ?>
<?php $date = $row['date'] ?>
<?php $time = $row['time'] ?>
<div class="similar-row">
    <?php echo $date ?> <?php echo $time ?>        
    <a href="<?php echo htmlspecialchars($row['link']) ?>">
        <?php echo $row['title'] ?> 
    </a> - <?php echo $row['user_name'] ?>
</div>
<?php endforeach; ?>

<?php if (!empty($pager)): ?>
<?php echo $pager; ?> 
<?php endif; ?>