I have a little problem with DBM functions in PHP. It seems to be fooled, maybe by carriage returns in flat text file? Any help will be apreciated. Thanks in advance.
-----8><---------------------------------
$db=dbmopen('db/test.db','n');
dbminsert($db,'uno','Joaquin');
dbminsert($db,'dos','David');
dbminsert($db,'tres','Daniel');
dbmclose($db);
$db=dbmopen('db/test.db','r');
$n=dbmfetch($db,'dos');
print $n.'<hr>';
$k=dbmfirstkey($db);
while($k)
{
print $k.':#'.dbmfetch($db,$k).'#<br>';
$k=dbmnextkey($db,$k);
}
dbmclose($db);
-----8><---------------------------------
And output is:
avid4
uno:#oaquin3#
dos:#avid4#
tres:#Daniel#