PHP-消息:在CodeIgniter中为foreach提供了无效的参数

我在应用Codeigniter的过程中遇到了几个问题-创建了一个函数

function searchUnivtab() {
        $country = $this->input->post('countryKey');
        $state = $this->input->post('stateKey');
        $level = $this->input->post('level');
        $degType = $this->input->post('degType');       
        $country = str_replace('%20', ' ', $country);
        $state = str_replace('%20', ' ', $state);
        $degType = explode('~', $degType);
        $data = @$this->get->getSearchedUniversityTab($country, $state, $level, $degType[1]);
        $html = '';
        $i = 0;
        foreach($data as $d)
        {
            $html .= '<option value="'.$d['name'].'">'.$d['name'].'</option>';
        }
        echo $html; die;
    }

错误为:遇到PHP错误严重性:警告消息:为foreach()提供无效的参数,行号:270,位于foreach行

与上述代码有关的任何帮助吗?

解决方法:

在下面的行中删除@以查看是否产生任何错误
所以更换

$data = @$this->get->getSearchedUniversityTab($country, $state, $level, $degType[1]);

$data = $this->get->getSearchedUniversityTab($country, $state, $level, $degType[1]);

相关文章

页面搜索关键词突出 // 页面搜索关键词突出 $(function () {...
jQuery实时显示日期、时间 html: &lt;span id=&quot...
jQuery 添加水印 &lt;script src=&quot;../../../.....
中文:Sys.WebForms.PageRequestManagerParserErrorExceptio...
1. 用Response.Write方法 代码如下: Response.Write(&q...
Jquery实现按钮点击遮罩加载,处理完后恢复 思路: 1.点击按...