PHP-消息:在CodeIgniter中为foreach提供了无效的参数
内容导读
互联网集市收集整理的这篇技术教程文章主要介绍了PHP-消息:在CodeIgniter中为foreach提供了无效的参数,小编现在分享给大家,供广大互联网技能从业者学习和参考。文章包含922字,纯文字阅读大概需要2分钟。
内容图文
我在应用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]);
内容总结
以上是互联网集市为您收集整理的PHP-消息:在CodeIgniter中为foreach提供了无效的参数全部内容,希望文章能够帮你解决PHP-消息:在CodeIgniter中为foreach提供了无效的参数所遇到的程序开发问题。 如果觉得互联网集市技术教程内容还不错,欢迎将互联网集市网站推荐给程序员好友。
内容备注
版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 gblab@vip.qq.com 举报,一经查实,本站将立刻删除。
内容手机端
扫描二维码推送至手机访问。