-1
これは私のコードの一部です。ファイルから読み込む必要があります。また、行にいくつかの操作を加えて(文字列を分割して)テーブル 私は文字列を処理するためにJavaスクリプトを使用する必要がありますが、私のコードはスクリプトタグ()のために動作しません そう、どのように私はPHPでjavascriptを使用して、同じ時間にファイルを扱うことができますか?PHPでjavascriptを使用してファイルを処理する方法
<?php
$myfile = fopen("scores.txt", "r");
echo "<script>";
echo "<table border=1 ><tr><th> Home Team </th><th> Home Team Score </th> <th> Away Team Score </th> <th> Away Team </th></tr>";
while(!feof($myfile)) {
$str = fgets($myfile);
echo " var temp = $str.split(':');";
echo "<tr> <td> temp[0] </td> <td> temp[2] </td><td> temp[3] </td> <td> temp[1]</td></tr>";
}
echo "</table></script>";
fclose($myfile);
?>
あなたは '
関連する問題