如果从用户那里得到输入,我想在文件中搜索任何结果,并显示结果:
$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 显示文本文件中的行