PHP Classes

Persistent Array: Access flat file databases like arrays

Recommend this page to a friend!
  Info   View files View files (2)   DownloadInstall with Composer Download .zip   Reputation   Support forum (2)   Blog    
Ratings Unique User Downloads Download Rankings
StarStarStar 47%Total: 867 All time: 4,044 This week: 206Up
Version License PHP version Categories
parray 1.0BSD License5.0PHP 5, Databases, Data types


This class can be used to access flat file databases like arrays.

The class extends the SPL ArrayObject class to be able to retrieve, add, update and delete entries in flat file database files using the DBM extension.

It also provides an iterator class to be able to traverse the entries in a DBM file using the regular array access functions.

Innovation Award
PHP Programming Innovation award nominee
March 2008
Number 6

Prize: One subscription to the PDF edition of the magazine by PHP Architect
Arrays are a very popular data type used in PHP to store a variable number of information items.

If you want to store information of arrays in a file or database so you can retrieve later, you can serialize the array and store it as a single data chunk.

However, that is not a very efficient solution. If the array is large, it may take too much time to store and retrieve changes or look up for elements.

This package takes advantage of the PHP 5 array iterator objects and implements a wrapper that stores and retrieve array elements in a flat file database managed by the DBM API.

This way the array can be stored persistently in files and its elements can be accessed very quickly.

Manuel Lemos
Picture of Cesar D. Rodas
  Performance   Level  
Name: Cesar D. Rodas is available for providing paid consulting. Contact Cesar D. Rodas .
Classes: 38 packages by
Country: Paraguay Paraguay
Age: 36
All time rank: 71 in Paraguay Paraguay
Week rank: 33 Down1 in Paraguay Paraguay Equal
Innovation award
Innovation award
Nominee: 25x

Winner: 5x

  Files folder image Files  
File Role Description
Plain text file parray.php Class Main class
Accessible without login Plain text file test.php Test Testing

 Version Control Unique User Downloads Download Rankings  
This week:0
All time:4,044
This week:206Up
 User Ratings  
 All time