Comments

Change post title on the fly

Wordpress Plugins

There are situations, where we want to alter the WordPress post title before saving it. Here is the code to append the current user’s name to the post title.

 

Comments

PHP Inheritance

php oops

Inheritance allows child classes to use its parent class members. This is very useful when you want to have common functionalities for most of the child classes in the base class. Inheritance in PHP:

  We are going to… Continue Reading

Comments

PHP Multiple Inheritance using Traits

php oops

The problem of multiple inheritances in PHP will occur when two classes are having same method. This can be avoided using “traits”. This feature is available from PHP version 5.4.0 Simple Multiple Inheritance using Traits:

 

Comments

PHP OOP – Class example

php oops

Like other programming languages, PHP is also support Object Oriented Programming with Overloading, Data Abstraction and Encapsulation etc. The latest version of PHP supports Namespaces which is similar to “Package” concept in Java. A simple PHP Class: