我在我的 View 文件中发现了这种错误类型,如下所示。请帮我解决这个错误。我很高兴能解决这个问题。我在等待正确答案 遇到 PHP 错误
严重性:通知
消息: undefined variable :备选
文件名:views/all_investor_relation.php
行号:47
<div class="tabs-left">
<?php
if($out){
foreach($out as $row=>$value){
$paths=base_url().'uploads/investor_relation/';
$image=$value['docpath'];
$title=$value['title'];
$imageso="<a href='$paths$image' title='$title' target='_blank'>$title</a>";
$content="<tr $alternative>
<td>".$i."</td><!-- this is line number 47-->
<td>".$imageso."</td>
}
echo $content;
}
else{
echo "<tr><td colspan='4'>Page not Available Available.</td></tr>";
}
?>
</div>
最佳答案
移除
中的变量$alternative $content="<tr $alternative>
<td>".$i."</td><!-- this is line number 47-->
<td>".$imageso."</td>
然后试试这段代码
$content="<tr><td>".$imageso."</td>";
关于php - codeigniter 上的错误 undefined variable 替代,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/29406151/