fgetcsv function
<?php
$fp = fopen('test.csv', 'rb');
$data = [];
$row = fgetcsv($fp);
while ($row !== false) {
$data[] = $row;
$row = fgetcsv($fp);
}
fclose($fp);
print_r($data);
<?php
$fp = fopen('test.csv', 'rb');
$data = [];
$row = fgetcsv($fp);
while ($row !== false) {
$data[] = $row;
$row = fgetcsv($fp);
}
fclose($fp);
print_r($data);
Leave a Comment
Cancel reply