PHP echo with $substr
<p>I've wrote this code:</p>

<pre><code>&lt;?php $offset = 0;  ?&gt;
&lt;?php  $Counter = 0; ?&gt;
&lt;?php $IsRD = 1; ?&gt;
&lt;?php $temp = 0;  ?&gt;
&lt;?php $TmpString = $_helper-&gt;productAttribute($_product, nl2br($_product-&gt;getprojector_compatibility()) , 'projector_compatibility');?&gt;

&lt;?php echo "&lt;table border=\"0\" align=\"center\"&gt;"; ?&gt;
&lt;?php echo "&lt;tr&gt;&lt;th&gt;&lt;h1&gt;Compatibility:&lt;/h1&gt;&lt;/th&gt;&lt;/tr&gt;"; ?&gt;

&lt;?php  if(strpos(  $TmpString, ";") == 0){  
    $Counter++; 
    $IsRD++;
    echo "&lt;tr&gt;&lt;td&gt;The #$Counter is at position - 0 &lt;/td&gt;";
 } ?&gt;

&lt;?php 
while($offset = strpos( $TmpString, ";", $offset + 1)){     

    if ($IsRD == 3) {
        $Counter++;
        $IsRD++;    
        echo "&lt;td&gt;" , $substr($TmpString,$temp,$offset-$temp) , "&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;";
        $IsRD=1;
        $temp=$offset;
    }
    else {
        $IsRD++;
        $Counter++;
**line 171** echo "&lt;td&gt;", $substr($TmpString,$temp,$offset-$temp),"&lt;/td&gt;";
        $temp=$offset;
    }   
 } ?&gt;
&lt;?php echo "&lt;/tr&gt;&lt;/table&gt;";  ?&gt;
</code></pre>

<p>and when I run it I get this error:</p>

<blockquote>
  <p>Fatal error: Function name must be a string in /home/...../view.phtml
  on line 171</p>
</blockquote>

<p>What am I missing / doing wrong?</p>
