I coded this PHP script as part of a coding challenge given by Catalyst IT Australia which is executed from the command line. It accepts a CSV file as an input (using command line options/directives) and processes the CSV file. The parsed file data is inserted into a PostgreSQL database. The CSV file contains test/dummy data, and the script processes this file appropriately.
This PHP script handles the following criteria:
The PHP script includes these command line options (directives):
Source code is available in my GitHub Repository.