(PHP 5 < 5.3.0, dbase 5, dbase 7)
dbase_get_header_info — 取得資料庫的標頭資訊
一個索引陣列,其中包含資料庫中每個欄位的項目。陣列索引從 0 開始。
每個陣列元素都包含一個欄位資訊的關聯陣列,如下所述:
如果無法讀取資料庫標頭資訊,則返回 false
。
範例 #1 顯示 dBase 資料庫檔案的標頭資訊
<?php
// dbase 檔案路徑
$db_path = "/tmp/test.dbf";
// 開啟 dbase 檔案
$dbh = dbase_open($db_path, 0)
or die("錯誤!無法開啟 dbase 資料庫檔案 '$db_path'.");
// 取得欄位資訊
$column_info = dbase_get_header_info($dbh);
// 顯示資訊
print_r($column_info);
?>