PHP Patterns: The Observer Pattern

The Observer Pattern is probably one of my favourite patterns.

It’s fairly straightforward, flexible, and best of all, the base classes you need to implement the Observer Pattern are available in the Standard PHP Library, so it should be available to all PHP5 applications.

Let’s jump straight in, and take a look at a possible scenario where we could use this pattern.

Continue reading “PHP Patterns: The Observer Pattern”

10 Useful PHP String-Related Functions

No need to elaborate much on this one. Here are ten very useful functions for manipulating strings. Some are very simple and straightforward, but are still very useful.

I would normally use these in class called something like Common_Strings, and make each function static but I’ll just provide them here as functions for you to use as you please.

Continue reading “10 Useful PHP String-Related Functions”