答案 0 :(得分:-1)
$handle = fopen("text.txt", "r");
if ($handle) {
$data = [];
while (($line = fgets($handle)) !== false) {
$data[] = explode(',', $line);
}
fclose($handle);
echo "<pre>";
print_r($data);
} else {
// error opening the file.
}