Using Interface in PHP

What is an interface in PHP? An interface is an important concept in an object oriented programming.

In this tutorial, we’ll discuss following points.

1. What is an interface?

2. How to create an interface in PHP.

3. What’s the importance of using an interface in our PHP application?

Interface in PHP

Interface in PHP

What is an Interface in PHP?

An Interface defines a contract for what a class can do, without saying anything about how the class can do it. Through interfaces, we define what a class can do, the classes that implement interface define how it can do it.

To understand the concept of an interface let’s take an example of a caching system. There are different types of caching available such as File system, Memcache, Redis etc. First, we need to define what a cache can do (I mean different operations), how we do it? we can do it through an interface. A class (Such as Memcache, Redis etc) which implements cache interface will define how they will do it.

NOTE – An interface will not add any additional functionality in your code but it outlines a standard format to which your classes need to use.

How to Install PHP 7 on Ubuntu

PHP 7 , the latest version of PHP was already released. It was released on December 3rd, 2015. PHP 7 comes with a number of new features, and the most amazing feature is  speed. PHP 7 provides an incredible performance boost to your web applications.

Here is the benchmark of PHP 7. PHP 7 benchmark.

In this tutorial, you’ll learn how to install PHP 7 on Ubuntu.

How to Install PHP, MySql, Apache in Ubuntu

How to Get Current Date and Time in Javascript

How to get current date and time in Javascript. How to display current date and time in Javascript.

In javascript date object is used to get current date and time. Using javascript date object our script can display and use the current date and time of a user system.

Let’s check how to get current date time in javascript.

How to Access Localhost from Anywhere using Any Device

How to access localhost from anywhere using any device.

How to Access Localhost from Anywhere

How many times, you have been working on an application (or an app) and you have designed and completed your application nicely. You have set up everything very nicely on your local system. Now you want to show this work to your client, who is sitting on a remote location.  Also, you want to test this application on a different device ( such as mobile, tablets etc). To do these things, either you have to host your application on a public server, or you can use any service which allows to access localhost from anywhere.

How to Install Composer on Mac OS

How to install composer on Mac OS.

What is Composer?

PHP Composer is a cross-platform dependency manager that allows you to manage package dependency in your project.

In my previous article, I have explained PHP Composer – how to manage package dependency in PHP through composer.

How to Install Composer on Mac OS

How to Install Composer on Mac OS