简体   繁体   中英

PHP export DBF file format

您对不使用dbase函数如何使用php导出DBF文件格式有任何想法吗?

dBase DBF file format is quite easy. Many years ago I had to import data from dbf/fpt (FoxPro), but I used standard PHP functions to read dbf files and just manually scanned the format of fpt files, where the long memo records were stored (dbf contained only pointers inside fpt).

You can check for example this description of dbf format: dbf format

From there you can see that in the beginning there is a file header, which contains all information about the defined fields (field name, size, type and optionally any constraints). You will use PHP's fwrite() function to write the required binary data into the dbf files. After the header, dbf file contains individual records separated by space/asterisk. Individual fields inside a record are not separated, as each field has static length.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM