php array find and format array
<p>I have this array in foreach loop  </p>

<pre><code>foreach ($data as $key =&gt; $value) {
    $filter_cat_name = $this-&gt;filter_cat_name($value['filter_cat_id']);
    $filter_sub_cat_name = $this-&gt;filter_sub_cat_name($value['sub_cat_id']);
    $var = array($filter_cat_name,$filter_sub_cat_name);
    print_r($var);
}

//foreach output
Array ( [0] =&gt; Brand Name [1] =&gt; Sony )  
Array ( [0] =&gt; Brand Name [1] =&gt; nokia )  
Array ( [0] =&gt; Display Size [1] =&gt; 360 x 640 )  
Array ( [0] =&gt; Brand Name [1] =&gt; Samsung )  
Array ( [0] =&gt; Display Size [1] =&gt; 480 x 640 ) 
</code></pre>

<p>How can I format or change like this </p>

<blockquote>
  <p>Brand Name<br>
  sony<br>
  nokia<br>
  samsung </p>
  
  <p>Display Size<br>
  360 x 640<br>
  480 x 640</p>
</blockquote>
