{"id":39750336,"url":"https://github.com/jamesgordo/php-csv-parser","last_synced_at":"2026-01-18T11:25:16.875Z","repository":{"id":45311294,"uuid":"93384461","full_name":"jamesgordo/php-csv-parser","owner":"jamesgordo","description":"Turn your CSV files into readable and accessable Data Objects.","archived":false,"fork":false,"pushed_at":"2024-09-04T12:26:16.000Z","size":45,"stargazers_count":29,"open_issues_count":1,"forks_count":8,"subscribers_count":5,"default_branch":"master","last_synced_at":"2025-09-24T06:58:12.356Z","etag":null,"topics":["csv","csv-parser","php"],"latest_commit_sha":null,"homepage":"https://packagist.org/packages/jamesgordo/php-csv-parser","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/jamesgordo.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2017-06-05T08:53:20.000Z","updated_at":"2024-11-15T13:18:08.000Z","dependencies_parsed_at":"2024-09-05T12:54:13.858Z","dependency_job_id":"8ea28b09-a08c-48a1-b3ec-78fddf8ab193","html_url":"https://github.com/jamesgordo/php-csv-parser","commit_stats":{"total_commits":31,"total_committers":5,"mean_commits":6.2,"dds":0.3870967741935484,"last_synced_commit":"f2777cd83222b5bf39893ba34bad3e7ed2c0e2b0"},"previous_names":[],"tags_count":7,"template":false,"template_full_name":null,"purl":"pkg:github/jamesgordo/php-csv-parser","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jamesgordo%2Fphp-csv-parser","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jamesgordo%2Fphp-csv-parser/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jamesgordo%2Fphp-csv-parser/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jamesgordo%2Fphp-csv-parser/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/jamesgordo","download_url":"https://codeload.github.com/jamesgordo/php-csv-parser/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jamesgordo%2Fphp-csv-parser/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":28535163,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-01-18T10:13:46.436Z","status":"ssl_error","status_checked_at":"2026-01-18T10:13:11.045Z","response_time":98,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.6:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"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-parser","php"],"created_at":"2026-01-18T11:25:16.801Z","updated_at":"2026-01-18T11:25:16.867Z","avatar_url":"https://github.com/jamesgordo.png","language":"PHP","funding_links":[],"categories":[],"sub_categories":[],"readme":"# PHP CSV Parser\n\n[![Build Status](https://travis-ci.org/jamesgordo/php-csv-parser.svg?branch=master)](https://travis-ci.org/jamesgordo/php-csv-parser) [![codecov](https://codecov.io/gh/jamesgordo/php-csv-parser/branch/master/graph/badge.svg)](https://codecov.io/gh/jamesgordo/php-csv-parser) [![stability-stable](https://img.shields.io/badge/stability-stable-green.svg)](https://github.com/jamesgordo/php-csv-parser)\n\nTurn your CSV files into readable and accessable Data Objects easily. This Library wraps the PHP's built-in\n`fgetcsv` function to provide you a hassle free CSV File parsing.\n\nEach row on your CSV file is dynamically transformed into Data Objects with keys set directly from the first\nrow of your CSV file.\n\n## PHP Version Support\n\nThe library has been tested to work on PHP Versions \u003e=5.3.\n\n## How to Use\n\nRun the following command in your terminal\n\n```\ncomposer require jamesgordo/php-csv-parser\n```\n\nOr simply add this to your `composer.json`\n\n```json\n{\n  \"require\": {\n    \"jamesgordo/php-csv-parser\": \"1.0.0\"\n  }\n}\n```\n\nThen run\n\n```\ncomposer update\n```\n\nCreate a Sample CSV File `users.csv`\n\n```csv\nid,first_name,last_name\n1,John,Doe\n2,Eric,Smith\n3,Mark,Cooper\n```\n\nExample Implementation\n\n```php\n\u003c?php\n// load vendor autoload\nrequire_once __DIR__ . '/vendor/autoload.php';\n\nuse JamesGordo\\CSV\\Parser;\n\n// Initalize the Parser\n$users = new Parser('/path/to/users.csv');\n\n// loop through each user and echo the details\nforeach($users-\u003eall() as $user) {\n\techo \"User Details: {$user-\u003eid} | {$user-\u003efirst_name} {$user-\u003elast_name}\";\n}\n\necho \"Total Parsed: \" . $users-\u003ecount() . \" Users\";\n\n```\n\n## Options\n\nYou can set the second as delimiter. The default delimiter is \",\".\n\n```php\n\u003c?php\n// load vendor autoload\nrequire_once __DIR__ . '/vendor/autoload.php';\n\nuse JamesGordo\\CSV\\Parser;\n\n// Initalize the Parser with custom delimiter\n$users = new Parser('/path/to/users.csv', \"|\");\n```\n\nYou can see the acceptable delimiters [here](https://github.com/jamesgordo/php-csv-parser/blob/master/src/Parser.php#L51)\n\nBelow are the list of the public methods you will most likely use.\n\n```php\n\t$users = new Parser('/path/to/users.csv')\t// Initializes the Parser\n\t$users-\u003esetCsv('/path/to/file.csv');\t\t// Sets the File to be Parsed\n\t$users-\u003egetCsv();\t\t\t\t// Returns the File to be Parsed\n\t$users-\u003echeckFile('/path/to/file.csv');\t\t// Validates if File is a valid CSV File\n\t$users-\u003eparse();\t\t\t\t// Triggers the Parsing of CSV file\n\t$users-\u003eall();\t\t\t\t\t// Returns array of Data Objects parsed from the CSV file\n\t$users-\u003ecount();\t\t\t\t// Returns the total rows parsed from the CSV file\n```\n\n## Version\n\n1.0.6\n\n## License\n\nMIT License\n\nCopyright (c) 2024 James Gordo\n\nPermission is hereby granted, free of charge, to any person obtaining a copy\nof this software and associated documentation files (the \"Software\"), to deal\nin the Software without restriction, including without limitation the rights\nto use, copy, modify, merge, publish, distribute, sublicense, and/or sell\ncopies of the Software, and to permit persons to whom the Software is\nfurnished to do so, subject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in all\ncopies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\nIMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\nFITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\nAUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\nLIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\nOUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\nSOFTWARE.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjamesgordo%2Fphp-csv-parser","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fjamesgordo%2Fphp-csv-parser","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjamesgordo%2Fphp-csv-parser/lists"}