从php中的shell脚本输出创建一个下拉列表

I have a shell script it produce list of project and directed to a text file.In php i want this project list in a drop down box and if selected any one project in that list it will directed to other php page.Please help me in this scenario.

My code here

Something like this would help:

echo "<select name='dummydd'>";
$handle = fopen("file.txt", "r");
if ($handle) {
    while (($line = fgets($handle)) !== false) {
        echo "<option value='".$line."'>".$line."</option>";
    }

    fclose($handle);
} else {
    // error opening the file.
}
echo "</select>";