A collection of PHP code snippets

This is a collection of php code snippets that seem to come in handy rather often. They are assembled here more for my own organization than anything else.
String: trim and convert to lowercase
A very straightforward but useful snippet. A string is first trimmed of any leading or trailing white space, and then converted [...]

Configuring NameVirtualHost in XAMPP’s Apache Server

Updated for XAMPP version 1.6.5

Some time ago, I decided to start phasing out static xhtml in favor of pages using PHP includes. To test these new pages, I used apachefriends.org’s wonderful XAMPP (which I really can’t recommend highly enough) to install Apache, MySQL, and PHP (among other things). Once I had my local server running, [...]