What is static keyword in PHP?

What is static keyword in PHP

Overview The static keyword is used to declare property or method of a class as static. If we declare a property or method as static in a class, we can access them without instantiating the class itself. The property or method can also be accessed statically within an instantiated class object. We can also define … Read more

Categories PHP

How to remove value from array in PHP?

How to remove value from array in PHP

We know that in PHP an array is a built-in data type that stores a number of values in one single variable. I have previously discussed arrays and different types of arrays in PHP in a post titled What is an associative array in PHP. In this article we will learn how to remove an … Read more

Categories PHP

What is final keyword in PHP?

What is final keyword in PHP

The final keyword in PHP The final keyword can be used for class, class methods, and class constants in PHP. If the final keyword is used before the class then it can be called a final class and if final keyword is used before any method of the class then it can be called a … Read more

Categories PHP

How to search a multi dimensional array in PHP?

How to search a multi dimensional array in PHP

We know that an array is a built-in data type of PHP that stores a number of values in one single variable. A multidimensional array is a type of an array that can store one or more than one arrays. I have discussed about array and different types of array in my previous post which … Read more

Categories PHP

What is trait in PHP?

What-is-trait-in-PHP

Trait in PHP PHP is a single inheritance language. It means a child class can inherit only from only one parent in PHP. I have added a diagram below to illustrate how single inheritance works in PHP. In the above example we can see that Class A is the root level parent class. Class B … Read more

Categories PHP

What is the difference between interface and abstract class in PHP?

What is the difference between interface and abstract class in PHP

One of the most important concepts in object oriented programming is abstract class and interface. In this article, we will learn the difference between interface and abstract class in PHP. Before that, we will learn what is the interface and abstract class And how to use them in PHP. What is an interface? Interfaces are … Read more

Categories PHP

What is an associative array in PHP?

associative array in PHP

In this article We will discuss in detail about associative array in PHP. In this article We will first discuss array and different types of array in PHP. While discussing different types of arrays, we will discuss the basics of associative arrays. And then We will discuss different aspects of associative arrays in more detail. … Read more

What is recursive function in PHP?

What-is-recursive-function-in-PHP

Defining Recursive function Recursion is a programming approach in which a function calls itself and the function is called a recursive function. This function call is made until a certain condition is met. This has to be handled very carefully to avoid infinite loops. Understanding the factorial example To understand how recursive functions work, we … Read more

Categories PHP

What is the difference between implode and explode in PHP?

What is the difference between implode and explode in PHP

The two functions implode() and explode() are in-built PHP functions. Before knowing the difference between these two functions, we will know how these functions work. implode function We will know the definition, syntax, parameters, return values, and an example code of the implode() function one by one. Definition The implode functions join array elements to … Read more

Categories PHP

What is data type in PHP?

What-is-data-type-in-PHP

Data type and variable in PHP Data type defines what type of value a variable can store. In programming language, a variable is a value that can change. PHP is a dynamically typed language. In dynamically typed language it is not required to specify the type of a variable because the type will be set … Read more

Categories PHP