{"id":16856677,"url":"https://github.com/jwage/easy-csv","last_synced_at":"2025-04-12T16:36:33.069Z","repository":{"id":724434,"uuid":"372249","full_name":"jwage/easy-csv","owner":"jwage","description":"EasyCSV is a simple Object Oriented CSV manipulation library for PHP 7.2+","archived":false,"fork":false,"pushed_at":"2021-04-08T22:20:41.000Z","size":86,"stargazers_count":254,"open_issues_count":7,"forks_count":58,"subscribers_count":12,"default_branch":"master","last_synced_at":"2025-04-09T17:45:53.392Z","etag":null,"topics":["csv","csv-reader","php"],"latest_commit_sha":null,"homepage":"","language":"PHP","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/jwage.png","metadata":{"files":{"readme":"README.markdown","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2009-11-13T23:24:05.000Z","updated_at":"2025-04-07T12:04:32.000Z","dependencies_parsed_at":"2022-07-18T12:19:07.500Z","dependency_job_id":null,"html_url":"https://github.com/jwage/easy-csv","commit_stats":null,"previous_names":[],"tags_count":7,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jwage%2Feasy-csv","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jwage%2Feasy-csv/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jwage%2Feasy-csv/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jwage%2Feasy-csv/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/jwage","download_url":"https://codeload.github.com/jwage/easy-csv/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248290076,"owners_count":21078923,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["csv","csv-reader","php"],"created_at":"2024-10-13T14:05:03.231Z","updated_at":"2025-04-12T16:36:33.049Z","avatar_url":"https://github.com/jwage.png","language":"PHP","funding_links":[],"categories":[],"sub_categories":[],"readme":"EasyCSV\n=======\n\nEasyCSV is a simple Object Oriented CSV manipulation library for PHP 7.2+\n\n[![Build Status](https://secure.travis-ci.org/jwage/easy-csv.png?branch=master)](http://travis-ci.org/jwage/easy-csv)\n[![Scrutinizer Quality Score](https://scrutinizer-ci.com/g/jwage/easy-csv/badges/quality-score.png?s=7e0e1d4b5d7f6be61a3cd804dba556a0e4d1141d)](https://scrutinizer-ci.com/g/jwage/easy-csv/)\n[![Code Coverage](https://scrutinizer-ci.com/g/jwage/easy-csv/badges/coverage.png?s=a02332bc4d6a32df3171f2ba714e4583a70c0154)](https://scrutinizer-ci.com/g/jwage/easy-csv/)\n[![Latest Stable Version](https://poser.pugx.org/jwage/easy-csv/v/stable.png)](https://packagist.org/packages/jwage/easy-csv)\n[![Total Downloads](https://poser.pugx.org/jwage/easy-csv/downloads.png)](https://packagist.org/packages/jwage/easy-csv)\n\n## Installation\n\nInstall via [composer](https://getcomposer.org/):\n\n```sh\ncomposer require jwage/easy-csv\n```\n\n## Reader\n\nTo read CSV files we need to instantiate the EasyCSV reader class:\n\n```php\n$reader = new \\EasyCSV\\Reader('read.csv');\n```\n\nYou can iterate over the rows one at a time:\n\n```php\nwhile ($row = $reader-\u003egetRow()) {\n    print_r($row);\n}\n```\n\nOr you can get everything all at once:\n\n```php\nprint_r($reader-\u003egetAll());\n```\n\nIf you have a file with the header in a different line:\n\n```php\n// our headers aren't on the first line\n$reader = new \\EasyCSV\\Reader('read.csv', 'r+', false);\n// zero-based index, so this is line 4\n$reader-\u003esetHeaderLine(3);\n```\n\nAdvance to a different line:\n\n```\n$reader-\u003eadvanceTo(6);\n```\n\nMore in the Reader unit test.\n\n## Writer\n\nTo write CSV files we need to instantiate the EasyCSV writer class:\n\n```php\n$writer = new \\EasyCSV\\Writer('write.csv');\n```\n\nYou can write a row by passing a commas separated string:\n\n```php\n$writer-\u003ewriteRow('column1, column2, column3');\n```\n\nOr you can pass an array:\n\n```php\n$writer-\u003ewriteRow(array('column1', 'column2', 'column3'));\n```\n\nYou can also write several rows at once:\n\n```php\n$writer-\u003ewriteFromArray(array(\n    'value1, value2, value3',\n    array('value1', 'value2', 'value3')\n));\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjwage%2Feasy-csv","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fjwage%2Feasy-csv","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjwage%2Feasy-csv/lists"}