What do you do when you’re writing a web app that needs to store data, but using a dedicated relational database system would be overkill? Many developers are taking advantage of PHP’s file editing capabilities to use plain text files to store and retrieve data. While this is a more lightweight solution, reading the contents of a file is not always the fastest way to retrieve stored information. Here’s my very own technique to use a database-like system with PHP files only, with just one line of code needed to grab the information, ready to be used.
This technique is best suited to situations when speed is required in accessing the data. It works best with small amounts of data, and it’s possible to store arrays, strings, numbers, etc. Let’s explore the basic theory behind the system.
Continue Reading Forget text files - here’s a .php only database system