ユーザーから入力を取得し、ファイルを検索して結果を表示したい場合:
$searchValue = $_POST['search'];
$handle = @fopen("home.txt","r");
# read line by line
while (($buffer = fgets($handle, 4096)) !== false && // the condtion for the $searchValue) {
echo '<tr>';
$array = explode(',', $buffer);
foreach($array as $val){
echo '<td>'.$val.'</td>';
}
echo '</tr>';
}
何をしなければならないかわかりません。関連する $searchvalues を含むテキスト ファイルの行を表示したいだけです。