function combo_from_file($file, $box_name)
{
$arr = file($file);
$str = '<select name="' . $box_name . '">';
foreach ($arr as $val) {
$val = trim($val);
$str .= '<option value="' . $val . '">' . $val . '</option>';
}
return $str . '</select>';
}
echo combo_from_file('name.txt', 'my_combo');