<body>
<h2>BT_db_test02ORG.php</h2>
<h3>?????????????</h3>

<form action = "BT_db_test02ORG.php" method = "post">

<p>
?????????????????????????????<br />
??????
<input name="kara" type="radio" value="0" checked="checked">??
<input name="kara" type="radio" value="1">???
<input name="kara" type="radio" value="2">???
</p>

<p>
????????????????????????????????<br />
??????
?<input name="seiki" type="radio" value="0" checked="checked">?????
?<input name="seiki" type="radio" value="1">????????
?<input name="seiki" type="radio" value="2">?????????
</p>
?????????????????????<br />
???????????????????????????????????????????????<br />
??????????????????????????????????????<br />
??????????????????????????????????????<br />
<p>
??????????
<input type="text" name='key_w'>
<input type="submit" name="Submit" value="??">?
</p>
</form>

<?php
//*********?????????? ***************//
$kara = $_POST['kara'];
$seiki = $_POST['seiki'];
$key_w = $_POST['key_w'];

//???????????

$fname ='BT_db_test02ORG.txt';
$data1 = @fopen($fname,'r') or exit('???????????????</body></html>');

//????????
switch($kara){
case 0;
echo "<h3>??????????</h3>";
$string_x = 0;//??[0]
break;
case 1;
echo "<h3>???????????</h3>";
$string_x = 1;//???[1]
break;
case 2;
echo "<h3>??????????</h3>";
$string_x = 3;//???[3]
break;

}

//???????
if($seiki == 0){
echo "<b>???????????</b>";
}else if($seiki == 1){
$key_w = '^'.$key_w;
echo "<b>??????????</b>";
}else if($seiki == 2){
$key_w = $key_w. "$";
echo "<b>??????????</b>";
}

//????
echo "<table border=\"1\" cellpadding=\"5\">\n";
echo "<tr><th>??</th><th>???</th><th>??</th><th>??</th><th>??</th><th>???</th></tr>\n";

echo "????<br />";
echo "?" .$kara."?????????<br />";
echo "?" .$key_w."????????";
echo "<h4>???????????????????</h4>\n";

//????

/*????????????????????????*/
while (!feof($data1)){//eof?????????
$string = fgetcsv_reg($data1);//???????????????????
if(preg_match("'$key_w'",$string[$string_x])){
//$class = "\"em\"";//????[1]????????????????
echo "<tr>\n";
foreach($string as $dt){//$dt??????????
echo "<td>" .$dt. "</td>\n";
}
echo "</tr>\n";

}
}
echo "</table>\n";
fclose($data1);

 

/*???????????????????????????
while (!feof($data1)){//eof?????????
$string = fgetcsv_reg($data1);//???????????????????
if(preg_match("'$key_w'",$string[$string_x])){
$class = "\"em\"";//????[1]????????????????
echo "<tr>\n";
foreach($string as $dt){//$dt??????????
echo "<td class=" .$class. ">" .$dt. "</td>\n";
}
echo "</tr>\n";

}
}
echo "</table>\n";
fclose($data1);
*/

 

/*????????????????????
while (!feof($data1)){//eof?????????
$string = fgetcsv_reg($data1);//???????????????????
if(preg_match("'$key_w'",$string[$string_x])){
$class = "\"em\"";//????[1]????????????????
}else{
$class = "\"normal\""; //????[1]??????????????????
}
echo "<tr>\n";
foreach($string as $dt){//$dt??????????
echo "<td class=" .$class. ">" .$dt. "</td>\n";
}
echo "</tr>\n";
}
echo "</table>\n";
fclose($data1);
*/

?>
</body>


????

??,??????????,?????????????,?,????,??
??,????,?????????????,?,??11????,????
??,?????,?????????????,?,????????JR?,?????
??,????,?????????????,?,????????????,????
??,????????,?????????????,?,????????JR?,????????
??,?????,?????????????,?,????????JR?,?????
??,????,?????????????,?,????????JR?,????
??,????,?????????????,??,????????JR?,????
??,????,?????????????,??,????????JR?,????
??,??????,?????????????,??,????????JR?,??????
??,???,?????????????,??,????????JR?,???
??,????,?????????????,?,????????JR?,????
??,?????,?????????????,?,????????JR?,?????
??,???????,?????????????,?,????????JR?,???????
??,?????,?????????????,?,????????JR?,?????
??,???????????,?????????????,?,????????JR?,???????????
??,????????????,?????????????,?,????????JR?,????????????
??,?????,?????????????,?,????????JR?,?????
??,?????,?????????????,??,????????JR?,?????
??,????,?????????????,??,????????JR?,??
??,????,?????????????,??,????????????,??
??,?????,?????????????,??,????????????,??
??,????,?????????????,?,????????????,??
??,????,?????????????,?,????????????,??
??,??????,?????????????,?,????????????,??
??,??????,?????????????,?,????????????,??
??,??????,?????????????,?,????????????,??
??,????,?????????????,?,????????????,??
??,????,?????????????,?,????????????,??
??,????,?????????????,??,????????????,??
???,?????,?????????????,??,????????????,??
???,?????,?????????????,??,????????????,??
???,???????,?????????????,??,????????????,??
???,?????????,?????????????,?,????????????,??
???,???????,?????????????,?,????????????,??
???,?????,?????????????,?,????????????,??
???,?????,?????????????,?,????????????,??
???,??????,?????????????,?,????????????,??
???,??????,?????????????,?,????????????,??
???,??????,?????????????,?,????????????,??
???,???????,?????????????,??,????????????,??
???,?????,?????????????,??,????????????,??
???,?????,?????????????,??,????????????,?????
???,??????,?????????????,??,????????????,??????
???,??????,?????????????,?,????????????,??????
???,??????,?????????????,?,????????????,??????
???,???????,?????????????,?,????????????,???????
???,?????,?????????????,?,????????????,?????
??,????,?????????????,?,????????????,????
??,????,?????????????,?,????????????,????
??,????,?????????????,?,????????????,????
??,????,?????????????,??,????????????,????
??,?????,?????????????,??,????????????,?????
??,????,?????????????,??,????????????,????
??,??????,?????????????,??,????????????,??????
??,??????,?????????????,?,????????????,??????
??,??????,?????????????,?,????????????,??????
??,????,?????????????,?,????????????,????
??,????,?????????????,?,????????????,????
??,?????,?????????????,?,????????????,?????
???,??????,?????????????,?,????????????,??????
???,??????,?????????????,?,????????????,??????
???,????,?????????????,??,????????????,????
???,??????,?????????????,??,????????????,??????
???,??????,?????????????,??,????????????,??????
???,???????,?????????????,??,????????????,???????
??,????,?????????????,?,????????????,????
??,??????,?????????????,?,????????????,??????
??,???????,?????????????,?,????????????,???????
??,?????????,?????????????,?,????????????,?????????
??,?????,?????????????,?,????????????,?????
??,?????,?????????????,?,????????????,?????
????,??????,?????????????,?,????????????,????
????,??????,?????????????,??,????????????,????
????,??????,?????????????,??,????????????,????
????,??????,?????????????,??,????????????,????
????,??????,?????????????,??,????????????,????
????,??????,?????????????,?,????????????,????
???,?????,?????????????,?,????????????,?????
???,????,?????????????,?,????????????,????
???,?????,?????????????,?,????????????,?????
???,?????,?????????????,?,????????????,?????
???,????????????,?????????????,?,????????????,????????????
???,?????,?????????????,?,????????????,?????