Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- $ret = [];
- // echo __DIR__;
- $fp = fopen('./users.csv', "r");
- if(!$fp) {
- echo 'file not found';
- return;
- }else{
- $columns = array('userid', 'nickname', 'count');
- while($row=fgetcsv($fp)) {
- $ret[] = array_combine($columns, $row);
- }
- }
- echo json_encode($ret);
- return $ret;
- ?>
Add Comment
Please, Sign In to add comment