Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/marcelod/ci-csv-reader
CodeIgniter library that reads CSV files and returns an array.
https://github.com/marcelod/ci-csv-reader
Last synced: 3 months ago
JSON representation
CodeIgniter library that reads CSV files and returns an array.
- Host: GitHub
- URL: https://github.com/marcelod/ci-csv-reader
- Owner: marcelod
- Fork: true (alemohamad/ci-csv-reader)
- Created: 2016-11-17T02:20:20.000Z (about 8 years ago)
- Default Branch: master
- Last Pushed: 2013-12-09T17:31:06.000Z (about 11 years ago)
- Last Synced: 2024-04-17T03:13:02.433Z (9 months ago)
- Language: PHP
- Size: 97.7 KB
- Stars: 1
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: readme.md
Awesome Lists containing this project
README
# CodeIgniter Library: CSVReader
**ci-csv-reader**
## About this library
This CodeIgniter's Library is used to read a CSV file and return an array with its info.
Its usage is recommended for CodeIgniter 2 or greater.
* The original code can be found in [CSVReader](https://github.com/EllisLab/CodeIgniter/wiki/CSVReader) by Pierre-Jean Turpeau.
## Usage
```php
$this->load->library('CSVReader');
$csvData = $this->csvreader->parse_file('Test.csv'); //path to csv file
```### Accepted CSV Format:
```csv
Title,Text,DateTitle,Some description.,2013-09-28 16:56:09
Another item,"Another description, my friend.",2013-11-13 15:30:41
First title,Description from the item.,2013-12-08 11:33:55
```### Result:
```
Array(
[0] => Array(
[Title] => Title,
[Text] => Some description.,
[Date] => 2013-09-28 16:56:09
)
[1] => Array(
[Title] => Another item,
[Text] => Another description, my friend.,
[Date] => 2013-11-13 15:30:41
)
[2] => Array(
[Title] => First title,
[Text] => Description from the item.,
[Date] => 2013-12-08 11:33:55
)
)
```![Ale Mohamad](http://alemohamad.com/github/logo2012am.png)