There are some certain designs in software development like in designing an aircraft. While designing an aircraft designers use some patterns, for example there is a pattern for landing gears. They are located under the aircraft and they have supports which are joint to the fuselage. Designer does not have to design a landing gear from scratch, if it is not needed, because he knows what is the pattern of a landing gear. Patterns are like templates while designing and building an automobile or aircraft.

Software developers also need patterns for building their software projects like in other engineering disciplines. People say that Php is not suitable for object oriented programming in their blogs, it is not true! Php gives you chance to develop in procedural concept or in oop concept. Sometimes you need procedural programming though (but dont use procedural programming a lot in your oop projects it will turn your code to spaghetti code, just use where you have to use procedural programming). I used java which is known as the most suitable programming language for oop, but when you see a Main function to run your program people who say php is not a suitable language for oop may think about this about other oop languages like java,c++. This is not true again all of these languages try to make their job, there is not a better or worse programming language. There are programming languages which are suitable for your needs and which are not suitable.

I use object oriented programming in my projects with design patterns they help you to solve some problems in an efficient and fast way.

In php.net site we see some patterns like factory and singleton design patterns, this is really cool, just look at the code dont try to understand if you do not know abything about design pattern i will explain what are design patterns and when we should use them.

class Example
{
    // The parameterized factory method
    public static function factory($type)
    {
        if (include_once 'Drivers/' . $type . '.php') {
            $classname = 'Driver_' . $type;
            return new $classname;
        } else {
            throw new Exception('Driver not found');
        }
    }
}