This might be easy, but i could not get solution for it as is novice and learning on the php
I want to put the output into a variable called $list so that it becomes
<?php $list .= '<h3> <?php echo $this->escape($item->n_make); ?> <?php echo $item->n_model; ?>
</h3>
<p> <?php echo $item->n_month; ?> <?php echo $item->n_year; ?> </p>
<p> <?php echo $item->n_short_description; ?> </p>
<hr/>'
?>
But the syntax is incorrect as its like php within php How to get value of $list capturing in details
and can then use in explode function
<?php
$listings = explode("<hr/>", $list);
$numberOfListings = count($listings);
---- conditions
echo $listings;
?>