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.