|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
[2006-10-16 20:13 UTC] cory dot nemelka at nemelkaitgroup dot com
Description: ------------ Since upgrading from PHP v5.0 to PHP v5.1, the dbase_open function no longer works. The problem appears to be a byte-ordering problem in the "file-type" byte of the header (offset 0). The problem is illustrated below. This file opens properly under PHP v5.0 but returns an "unable to get header" under v5.1. Reproduce code: --------------- # od -tx1 mattndea.dbf | head 0000000 30 06 0a 04 eb ac 03 00 08 03 33 00 00 00 00 00 0000020 00 00 00 00 00 00 00 00 00 00 00 00 00 03 00 00 0000040 4d 45 4d 42 45 52 5f 49 44 00 00 43 01 00 00 00 0000060 0c 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 0000100 44 41 54 45 00 00 00 00 00 00 00 44 0d 00 00 00 0000120 08 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 0000140 54 49 4d 45 00 00 00 00 00 00 00 43 15 00 00 00 0000160 07 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 0000200 4c 4f 43 41 54 49 4f 4e 00 00 00 43 1c 00 00 00 0000220 04 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 # od -tx2 mattndea.dbf | head 0000000 0630 040a aceb 0003 0308 0033 0000 0000 0000020 0000 0000 0000 0000 0000 0000 0300 0000 0000040 454d 424d 5245 495f 0044 4300 0001 0000 0000060 000c 0000 0000 0000 0000 0000 0000 0000 0000100 4144 4554 0000 0000 0000 4400 000d 0000 0000120 0008 0000 0000 0000 0000 0000 0000 0000 0000140 4954 454d 0000 0000 0000 4300 0015 0000 0000160 0007 0000 0000 0000 0000 0000 0000 0000 0000200 4f4c 4143 4954 4e4f 0000 4300 001c 0000 0000220 0004 0000 0000 0000 0000 0000 0000 0000 PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
|
|||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Sun Oct 26 11:00:02 2025 UTC |
<?php $dbh=dbase_open("o1.dbf", 0); $ci = dbase_get_header_info($dbh); print_r($ci); ?>