Write a php program to print prime numbers between 1 to N. In this tutorial, we are going to use Sieve of Eratosthenes algorithm to print prime numbers between 1 to N.
Write a program to implement binary search in PHP. Given a sorted array, we have to write a PHP code to search an element using binary search algorithm.
What’s a PHP composer? How to use PHP composer in your PHP Application? What are the benefits of using composer in your application?
PHP Composer is a dependency manager. It manages the dependency of PHP packages in your application. Using composer you can pull the required library and dependencies and manage them in one place. The concept of a composer is similar to npm in node.js and gem in Ruby.
Let’s first understand what is a dependency.
What are PHP Magic Methods?
PHP Magic methods are a specialized method that is executed in response to a specific event. Each magic methods start with two underscores(__) and it is called automatically when a certain condition is met. It triggers custom behaviors defined by a programmer inside the class. Some of the magic methods are __construct(), __destruct(), __toString(), __get(), __set(), __call() etc.
In this tutorial, we are going to explore these magic methods.
PHP Magic Methods
PHP 7 Features Explained with Code Examples.
PHP 7 is the newest version of PHP released last year. PHP community has introduced a lot of new features in their latest version. In this tutorial, we are going to learn about new features added in PHP 7.