first commit
This commit is contained in:
21
app/read.php
Normal file
21
app/read.php
Normal file
@@ -0,0 +1,21 @@
|
||||
<?php
|
||||
|
||||
$file = 'data.csv';
|
||||
$data = [];
|
||||
|
||||
if (file_exists($file)) {
|
||||
|
||||
$handle = fopen($file, 'r');
|
||||
|
||||
while (($row = fgetcsv($handle)) !== false) {
|
||||
$data[] = [
|
||||
"number" => $row[0]
|
||||
];
|
||||
}
|
||||
|
||||
fclose($handle);
|
||||
}
|
||||
|
||||
header('Content-Type: application/json');
|
||||
echo json_encode($data);
|
||||
?>
|
||||
Reference in New Issue
Block a user