dBase
在线手册:中文 英文
PHP手册

简介

These functions allow you to access records stored in dBase-format (dbf) databases.

dBase files are simple sequential files of fixed length records. Records are appended to the end of the file and delete records are kept until you call dbase_pack().

The types of dBase fields available are:

Available types of fields
Field dBase Type Format Additional information
M Memo n/a This type is not supported by PHP, such field will be ignored
D Date YYYYMMDD The field length is limited to 8
N Number A number You must declare a length and a precision (the number of digits after the decimal point)
C String A string You must declare a length. When retrieving data, the string will be right-padded with spaces to fit the declared length.
L Boolean T or Y for TRUE, F or N for FALSE Stored and returned as an integer (1 or 0)
F Float A float number Support for this type of field was added in PHP 5.2.0

Note:

此扩展已被移至 » PECL 资源库且不再与 PHP 捆绑。5.3.0.

Warning

There is no support for indexes or memo fields. There is no support for locking, too. Two concurrent web server processes modifying the same dBase file will very likely ruin your database.

We recommend that you do not use dBase files as your production database. Choose any real SQL server instead; » MySQL or » Postgres are common choices with PHP. dBase support is here to allow you to import and export data to and from your web database, because the file format is commonly understood by Windows spreadsheets and organizers.


dBase
在线手册:中文 英文
PHP手册
PHP手册 - N: 简介

用户评论:

andreas dot maul at bgr dot de (09-Sep-2010 03:49)

dbase functions can be used to create/manipulate the attribute list in shape files (which consist actually of at least three different files: *.shp for geometries, *.shx for the shape index and *.dbf containing the attribute table for the geometries). This industrial standard is still very popular and frequently used due to short access times not only by commercial products but also by open source products like UMN mapserver.

oto dot brglez at agenda dot si (23-Feb-2009 02:25)

If you have xls or ods file with data. You can open file in OpenOffice Calc and save the table as dbf (dBase file) and the use this extension to manipulate data.

Usualy this gives better results than just saving as XML. or CSV.