I’ve blogged twice recently about sorting an array of structures in ColdFusion, using both pure CF, and dipping into Groovy. This time we’ll look at how we can easily do the same task in PHP. In this post I will take the same problem, a complex array containing a structure (in PHP, an associative array), [...]
Archive for the ‘PHP’ Category
Sorting a Complex Array of Products in PHP
Posted: 17th November 2009 by Adam Presley in Development, PHPTags: Development, PHP, Sorting
Simple LRU Cache Class in PHP
Posted: 27th May 2009 by Adam Presley in Development, PHPTags: Development, PHP
In my ongoing effort to further enhance my PHP framework I started recently working on a caching mechanism. For the time being I am using the PEAR library’s Cache_Lite (I’ve blogged on this before, so check it out) to handle the details of persisting the cache data, locking, and all that fun jazz. Cache_Lite, however, [...]
Useful Date/Time Class for PHP
Posted: 2nd February 2009 by Adam Presley in Development, PHPTags: PHP
As programmers we should always strive to better ourselves by improving our craft by taking pride that what we build is not only useful, but can continue to be useful for a long time to come. Part of this strategy involves writing code that exhibits resuse, high cohesion, and loose coupling. Therefore every developer should, [...]
Parsing PHP-style Placeholders for SQL Scripts
Posted: 5th September 2008 by Adam Presley in Development, PHPTags: code, PHP
If you’ve ever used PHP, you’ve probably used, or at least seen, the PRINTF and/or SPRINTF functions. These oldie, but goodie, functions are stolen… err… borrowed from the old C language world. Both functions support the abililty to have placeholders, which when evaluated, are replaced with the value in a comma-delimited list in the appropriate [...]
New Tutorial on Complex Objects in PHP Sessions
Posted: 6th April 2008 by Adam Presley in Development, PHPTags: Development, OOP, PHP
For those PHP programmers out there new to the language I have posted a new tutorial (just a little one ) on how to store and retrieve complex objects (classes) in PHP session ($_SESSION). You can find it under Software Development, or go straight to it here. Cheers!
My First Plugin
Posted: 16th October 2007 by Adam Presley in Development, PHPTags: Development, PHP, Plugins, wordpress
Yes, ladies and gentlemen, I have started learning how to write WordPress plugins. My first plugin is one that removes the word “Private: ” from the beginning of blog and page titles (when they are saved with a status of private). The way this works is by creating a function that takes one argument. I [...]
Caching in PHP: Cache_Lite
Posted: 30th May 2007 by Adam Presley in Development, PHPTags: Development, PHP
For many web application developers the concept of caching is foreign. Most of us build our pages, query our databases, and spit out the results. This is usually sufficient as the content is entirely dynamic. There are times, however, when the data, although not static, doesn’t change very frequently, and can benefit from caching. Caching [...]

