0

I am getting an unexpected T_variable on line 445 but I can't see where the problem is, can anyone see where the problem is which is causing this error?

//start:procedure
$img_result = '';
if(empty($arrImageFile[$key])){
  $img_result = ' ';
}else{
  $img_$result .=  '<ul class="qandaul"><li>'; //line 445
   if(is_array( $arrImageFile[$key] )){
    foreach($arrImageFile[$key] as $filename){
     $img_$result.= CreateLink($filename, "image");
    }
   }else{
    $img_$result.= CreateLink($arrImageFile[$key], "image");
   }
   $img_result.= '</li></ul>';
}
//end:procedure

echo '<td width="11%" class="imagetd">'.$img_result.'</td>' . PHP_EOL;
4

1 回答 1

0

$img_$result应该是:$img_result这也应该固定在第 448 和 451 行。请记住,T_VARIABLE通常指的是$变量符号。如果您想使用变量特征的变量,您应该使用$$img_result${$img_result}更好地理解。

于 2013-01-27T03:03:47.777 回答