If you've ever created a full PHP application, you know how much of a pain it can be to hunt down configuration variables (like file paths or database names) to change them down the line. Well, DevShed just might have something to help you out.
In their latest, Configuration Manipulation With PHP Config, they step you through using the PEAR "PHP Config" class to create, modify, and remove items from a sample configuration file. Using this class makes it as simple as creating an array and telling PHP Config what kind of file to write (ex. GenericConf, InFile, XML). They give you a few samples of what the code looks like versus the output as well, so you can get familiar with how the class really works.
Of course, they get into more detailed examples later on in the article, but this quite the handy tool, especially if you've been strugging with PHPs parse_ini_file not doing exactly what you need. You can even access information similar to a DOM model, with functions like: getParent, getChild, and getItemPosition...




