I will one day come up with a better way to show PHP in my blog but in the meantime I'm not going to let that stop me from sharing a handy script I put together yesterday. I grabbed most of the code from examples on PHP.net
but the examples as they were didn't do what I wanted.
What I came up with is a short PHP script
that shows the DBA handlers available then dumps the contents of the database file specified in the $db variable up at the top. It uses the "db4" handler, you can change that (and whatever else) to suit your needs. I made this the other day just to have a look in some of the LDAP database files that I was messing with yesterday
So here's the BDB dump script
as text. Download it, rename it as .php and enjoy.