我写了这段代码:
<?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>"; ?>
当我运行它时,我得到了这个错误:
致命错误:函数名称必须是第 171 行 /home/...../view.phtml 中的字符串
我错过了什么/做错了什么?