0
我在我的php中有一个循环,它接受两个表的数据库值并将它们显示在CodeIgniter下拉列表中 - 但是,在news_types循环之后,数组不会自行重置,它会使用类别数据。 。谁能帮我?Array not resetting
感谢
//inside a loop
if(isset($news_types)) {
foreach($news_types as $type) {
$options[$type['id']] = ucwords($type['type']);
}
}
if(isset($categories)) {
foreach($categories as $category) {
$options[$category['id']] = ucwords($category['category']);
}
}
echo '<p>';
echo format_label($field);
echo form_dropdown($field, $options, check_value($field, $submitted, $record->$field));
echo '</p>';