php - codeigniter 上的错误 undefined variable 替代

标签 php html codeigniter

我在我的 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/

相关文章:

php - Json转php,json_decode返回NULL

javascript - 根据 php if/else 语句的结果创建 javascript 操作

jquery - DIV 背景 : how to fix position

html - 为什么 CSS 没有使 SVG 风格化?

php - Codeigniter Framework 中的语言问题

php - CodeIgniter:未加载输入类(或者我认为如此)

php - 在 PHP 中获取大文件的 mimetype

PHP Magic 比简单地设置类属性更快?

html - ionic2自定义图标大小和按钮大小

php - 无法将 css 加载到我在 CodeIgniter 中的 View 中