To avoid long data entry sessions, a nice addition to a system, such as the Bug Tracker that we have been putting in place in this chapter, would be to provide users with the ability to import large amounts of entries from an external file in a single operation. To accomplish this task, the Comma-Separated Values (CSV) file format is very convenient, since it can be edited by most spreadsheet editors and can be read using standard PHP function calls.
This recipe implements a CSV-based import function in our bug tracking system.
You should have already followed the Implementing a search function to retrieve custom table data recipe to have an existing framework to augment. Alternatively, you can get the resulting code (
Chapter 8/ch8-bug-tracker/ch8-bug-tracker-v7.php) from the code bundle and rename the file