{"id":19426029,"url":"https://github.com/stdakov/csv","last_synced_at":"2025-07-26T12:33:56.746Z","repository":{"id":57059292,"uuid":"59094968","full_name":"stdakov/csv","owner":"stdakov","description":"PHP CSV library","archived":false,"fork":false,"pushed_at":"2016-05-18T10:59:17.000Z","size":6,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-02-25T05:15:32.455Z","etag":null,"topics":["csv","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/stdakov.png","metadata":{"files":{"readme":"README.md","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":"2016-05-18T08:06:28.000Z","updated_at":"2021-02-21T05:42:23.000Z","dependencies_parsed_at":"2022-08-24T14:53:27.147Z","dependency_job_id":null,"html_url":"https://github.com/stdakov/csv","commit_stats":null,"previous_names":[],"tags_count":1,"template":false,"template_full_name":null,"purl":"pkg:github/stdakov/csv","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/stdakov%2Fcsv","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/stdakov%2Fcsv/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/stdakov%2Fcsv/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/stdakov%2Fcsv/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/stdakov","download_url":"https://codeload.github.com/stdakov/csv/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/stdakov%2Fcsv/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":267168763,"owners_count":24046707,"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","status":"online","status_checked_at":"2025-07-26T02:00:08.937Z","response_time":62,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"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","php"],"created_at":"2024-11-10T14:05:42.184Z","updated_at":"2025-07-26T12:33:56.559Z","avatar_url":"https://github.com/stdakov.png","language":"PHP","funding_links":[],"categories":[],"sub_categories":[],"readme":"#CSV tool\nThis is a very powerful tool for reading, creating, updating or downloading a csv file.\nAlso you can read file from the end.\n\n##Installation\nThe preferred way to install this tool is through [composer](http://getcomposer.org/download/).\n\nEither run\n\n```\nphp composer.phar require stdakov/csv\n```\n\nor add\n\n```\n\"stdakov/csv\": \"*\"\n```\n\n\n##Usage\n\n```php\nrequire 'vendor/autoload.php';\n```\n\n\nOptional:\nif you want you can use custom filename. \nIt there is no custom filename it will create file with name date(\"Y-m-d_H:i:s\") . '_' . export.csv \n\n```php\n$file = 'export.csv'; //It is optional\n```\n\nAlso you can show in witch folder file will be saved.\n\n```php\n$path = 'somePath'; //It is optional\n```\n\nCreate instance\n\n```php\n$csv = new \\Dakov\\CSV();\n```\n\nor with custom file and path\n\n```php\n$csv = new \\Dakov\\CSV($path);\n$csv-\u003esetFile($file);\n```\n\nExample data for insert:\n\n```php\n$data = [\n    [\n        'column1' =\u003e 1,\n        'column2' =\u003e 1,\n    ],\n    [\n        'column1' =\u003e 2,\n        'column2' =\u003e 2,\n    ],\n];\n```\n\nInsert and create file with data\n\n```php\n$csv-\u003ecreate($data);\n```\n\nExample data for append:\n\n```php\n$data = [\n    [\n        'column1' =\u003e 3,\n        'column2' =\u003e 3,\n    ],\n    [\n        'column1' =\u003e 4,\n        'column2' =\u003e 4,\n    ],\n    [\n        'column1' =\u003e 5,\n        'column2' =\u003e 5,\n    ],\n];\n```\n\nAppend some data to the file:\n\n```php\n$csv-\u003eappend($data);\n```\n\nReturn assoc array with all data:\n\n```php\nprint_r($csv-\u003eread());\n```\n\nReturn assoc array with all reverse data: \n\n```php\nprint_r($csv-\u003ereadReverse());\n```\n\nYou can set line limit (it is optional)\n\n```php\nprint_r($csv-\u003ereadReverse(2));\n```\n\nDownload file\n\n```php\n$csv-\u003edownload();\n```\n\nalso you can delete file after download \n\n```php\n$csv-\u003edownload(true);\n```\n\nThe MIT License (MIT)","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fstdakov%2Fcsv","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fstdakov%2Fcsv","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fstdakov%2Fcsv/lists"}