I’ve wrote this code:
<?php $offset = 0; ?>
<?php $Counter = 0; ?>
<?php $IsRD = 1; ?>
<?php $temp = 0; ?>
<?php $TmpString = $_helper->productAttribute($_product, nl2br($_product->getprojector_compatibility()) , 'projector_compatibility');?>
<?php echo "<table border=\"0\" align=\"center\">"; ?>
<?php echo "<tr><th><h1>Compatibility:</h1></th></tr>"; ?>
<?php if(strpos( $TmpString, ";") == 0){
$Counter++;
$IsRD++;
echo "<tr><td>The #$Counter is at position - 0 </td>";
} ?>
<?php
while($offset = strpos( $TmpString, ";", $offset + 1)){
if ($IsRD == 3) {
$Counter++;
$IsRD++;
echo "<td>" , $substr($TmpString,$temp,$offset-$temp) , "</td></tr><tr>";
$IsRD=1;
$temp=$offset;
}
else {
$IsRD++;
$Counter++;
**line 171** echo "<td>", $substr($TmpString,$temp,$offset-$temp),"</td>";
$temp=$offset;
}
} ?>
<?php echo "</tr></table>"; ?>
and when I run it I get this error:
Fatal error: Function name must be a string in /home/…../view.phtml
on line 171
What am I missing / doing wrong?
the line must be
not
You’ve got also wrong code in echo lines, like this one:
Replace commas with dots (string concatenation operator) and do what I wrote above with dollar sign ($)
And better readable coding style: