A while ago I was tasked with designing a small application that calculates the distance between two postcodes. The overall purpose of the application was to fetch the three retail store chains that were nearest to the consumer’s postcode. I naturally assumed the easiest way to do this was to compare the longitude and latitude [&hellip...
Inheritance in PHP allows for connections between different classes. Child classes can inherit attributes and methods from parent classes, allowing them to become more specialised by extending the functionality of the base class. For a real world example, you can think of a base class Fruit, with a derived class Apple, which in turn has [&hellip...
The PHP goto operator was released in PHP 5.3. It permits you to jump from one section of code to another. Example usage: for( $x = 0; $x <= 1000; $x++ ) { if( $x == 999 ) goto finish; } echo "The for loop ended naturally."; finish: echo "Exited the loop prematurely and jumped [&hellip...
My previous post covered OOP Basics in PHP 5. I was considering writing one long blog post about the more advanced features of OOP in PHP, however thought I would be able to cover them in more detail if I were to go over one concept at a time. This post will address: Static Methods [&hellip...
Introduction PHP is a remarkable language, and Object Oriented Programming (OOP) is a remarkable concept. With object oriented design at the heart of PHP 5 and 6, developers can’t afford not to use it; it is a fundamental skill in increasing demand. This tutorial will introduce the basics of OOP in PHP5, and will show [&hellip...