Are there any alternative methods or tools in PHP for importing data from a DBF file into a MySQL database that may be more efficient than using dbase_get_record()?

The issue with using dbase_get_record() to import data from a DBF file into a MySQL database is that it may not be the most efficient method due to limitations and performance issues. One alternative method is to use a library like PHPExcel or PHPSpreadsheet to read the DBF file and then insert the data into the MySQL database using SQL queries.

// Include the PHPSpreadsheet library
require 'vendor/autoload.php';

use PhpOffice\PhpSpreadsheet\IOFactory;

// Load the DBF file using PHPSpreadsheet
$spreadsheet = IOFactory::load('path/to/dbf_file.dbf');
$sheet = $spreadsheet->getActiveSheet();

// Connect to MySQL database
$pdo = new PDO('mysql:host=localhost;dbname=database_name', 'username', 'password');

// Iterate through rows and insert data into MySQL database
foreach ($sheet->getRowIterator() as $row) {
    $rowData = $row->toArray();
    
    // Prepare SQL query to insert data into MySQL database
    $stmt = $pdo->prepare("INSERT INTO table_name (column1, column2) VALUES (?, ?)");
    $stmt->execute([$rowData[0], $rowData[1]]);
}