php将输出传递给变量

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;
  ?>

It's just simple concatenation:

$list .= '<h3> ' . $this->escape($item->n_make) . $item->n_model . '</h3>
    <p> ' . $item->n_month . ' ' . $item->n_year . '</p>
    <p> ' . $item->n_short_description . ' </p>
    <hr/>';