<html>
<head>
<title>fopen003_1.php</title>
</head>

<body>
<h1>yasai.php</h1>
fopen???????????????<br />
strtok()??????????????????<br />
????<br />
???????????yasai.txt?<br />
????100?136<br />
????20?18<br />
???????120?131<br />
?????50?39<br /><br />

<h4>????????yasai.php?</h4>
<?php
$fname = 'yasai.txt';
$data1 = @fopen($fname,'r') or exit('???????????????</body></html>');
echo "<table border=\"1\" cellpadding=\"5\">\n";
echo "<tr><th>??</th><th>???</th><th>???</th></tr>\n";
while(!feof($data1)){ //eof??????????
$string = trim(fgets($data1));//????????????????????
$dt = strtok($string,"\t"); //????????????????
echo "<tr>\n";
while($dt){ //$dt??????????
echo "<td>".$dt. "</td>\n";
$dt = strtok("\t");
}
echo "</tr>\n";
}

echo "</table>";
fclose($data1);
?>

</body>
</html>


?yasai.txt????

??? 100 136
??? 20 18
?????? 120 131
???? 50 39