spekulatius / PHPScraper

A universal web-util for PHP.
https://phpscraper.de
GNU General Public License v3.0
515 stars 73 forks source link

Basic Processing for CSV files #139

Closed spekulatius closed 1 year ago

spekulatius commented 1 year ago

Implement basic CSV parsing functionality.

API

As usual, keep it simple:

Direct Call

$data = $web->parseCsv('https://test-pages.phpscraper.de/1.csv');

Chained

$data = $web->go('https://test-pages.phpscraper.de/1.csv')->parseCsv()

Separate Calls

$web->go('https://test-pages.phpscraper.de/1.csv');
$data = $web->parseCsv();

Associative Array vs. Simple Array

While the CSVs are flat by nature, they can be resolved into an associative array. This should be considered as an option. Suitable naming TBC.

Consideration