Php 将数据从文本文件加载到下拉列表

Php 将数据从文本文件加载到下拉列表,php,Php,我有一个文本文件和一个基于文本文件构建的表。我面临的问题是15到20个字符或更少的单词被跳过 我的文本文件数据如下: 模型;解决方案量成本;出售 bd45p;45英寸电视智能LED-UHD高分辨率;1;5000;8000 快递费;1500;950 安装;安装;1;1000;2500 atv582;安卓媒体;1;5555;6666 现在发生的事情是,快递费和安装行不会弹出数据,但该行会出现。Android Media少于15个字符,但该行会显示所有数据。当我向快递费和安装添加更多字符时,它们会出现

我有一个文本文件和一个基于文本文件构建的表。我面临的问题是15到20个字符或更少的单词被跳过

我的文本文件数据如下:

模型;解决方案量成本;出售

bd45p;45英寸电视智能LED-UHD高分辨率;1;5000;8000

快递费;1500;950

安装;安装;1;1000;2500

atv582;安卓媒体;1;5555;6666

现在发生的事情是,快递费和安装行不会弹出数据,但该行会出现。Android Media少于15个字符,但该行会显示所有数据。当我向快递费和安装添加更多字符时,它们会出现。我是否遗漏了什么

    $file = fopen("file.txt", "rb");
while (!feof($file)) {
    $line = fgets($file);
    $parts = explode(';', $line);
    echo "<tr><td class='text-center'><input class='form-control c_model' type='text' name='i_model[]' value='$parts[0]' placeholder='Model Number' readonly></td><td><select class='js-select2 form-control c_solutions' style='width: 100%;' name='i_solution[]' data-placeholder='Choose...'><option selected='selected'>$parts[1]</option></select></td><td class='text-center'><input class='form-control' type='text' name='i_quantity[]' value='$parts[2]'></td><td class='text-center'><input class='form-control c_costing' type='text'  value='$parts[3]' name='i_cost[]' placeholder='Cost' onkeyup='update(this);'></td><td><input class='form-control c_selling' type='text' name='' placeholder='Selling Price' onkeyup='update(this);'  value='$parts[4]'></td><td><input class='form-control c_gp' type='text' name='' placeholder='GP' readonly></td></tr>";
}
fclose($file);
?>
$file=fopen(“file.txt”、“rb”);
而(!feof($file)){
$line=fgets($file);
$parts=分解(“;”,$line);
回显“$parts[1]”;
}
fclose($文件);
?>
希望这有意义


问候

请分享您的代码。“我遗漏了什么吗?”-也许是常识?请阅读。@JaykumarGondaliya-我已经添加了我的代码above@CBroe-如果您不想提供帮助,请不要打扰自己。我认为您需要像这样尝试
“$parts[1]”。