我在应用 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;
}
错误为: A PHP Error was encountered
Severity: Warning
Message: Invalid argument supplied for foreach()
,在线Line Number: 270
_foreach
与上述代码相关的任何帮助?