私は以下のようなPHPコードを持っています:
$file1 = 'file1.txt';
$file2 = 'file2.txt';
$files1 = fopen($file1,'r');
$files2 = fopen($file2,'r');
$title = "";
while(!feof($files1)){
$data1 = explode(';', fgets($files1));
while(!feof($files2)){
$data2 = explode(';', fgets($files2));
}
//I want to output $data2[0] in here
//and want to make the calculation between $data1[0] - $data2[0]
// The problem is that I can not use the $data1[0] outside the while loop of file2 that make me can not calculation.
}
私がコードにコメントした問題。