Alok Prasad has Published 52 Articles

How to call parent constructor in child class in PHP?

Alok Prasad

Alok Prasad

Updated on 29-Jun-2020 11:06:57

We will face two cases while calling the parent constructor method in child class.Case1We can't run directly the parent class constructor in child class if the child class defines a constructor. In order to run a parent constructor, a call to parent::__construct() within the child constructor is required.Example Live DemoOutput: I ... Read More

How to convert XML file into array in PHP?

Alok Prasad

Alok Prasad

Updated on 29-Jun-2020 11:04:27

To convert the XML document into PHP array, we have to utilize some PHP functions. The procedure is explained underneath with an example.Step 1We have to create an XML file that needs to convert into the array.abc.xml           AL       A   ... Read More

How to Check if PHP session has already started?

Alok Prasad

Alok Prasad

Updated on 29-Jun-2020 09:48:01

In PHP, we utilize session_start() an inbuilt function to start the session .But the problem we face in a PHP script is if we execute it more than once it throws an error. So here we will learn how to check the session started or not without calling session_start() function ... Read More

Explain array_diff() in PHP

Alok Prasad

Alok Prasad

Updated on 29-Jun-2020 09:23:06

PHP offers different kinds of inbuilt functions having particular functionalities. The array_diff() is a predefined function in PHP and is utilized to figure the distinction between at least two arrays. If we utilize this function with two arrays it returns an array containing every element from array1 that are absent ... Read More

Explain str_split() function in PHP

Alok Prasad

Alok Prasad

Updated on 29-Jun-2020 09:21:53

PHP offers different kinds of inbuilt functions having particular functionalities. The str_split() is a predefined function in PHP and is utilized to convert the given string into an array.This function works in such a way that it parts the given string into smaller strings of length, the length is determined ... Read More

Explain array_map() function in PHP

Alok Prasad

Alok Prasad

Updated on 29-Jun-2020 09:20:55

PHP offers various types of inbuilt functions to perform distinctive functionalities. The array_map() is an inbuilt function in PHP and it works with PHP array.This function works in such a way that it sends every component of an array to a predefined function and returns an array with new values ... Read More

Explain substr() function in PHP

Alok Prasad

Alok Prasad

Updated on 29-Jun-2020 09:19:10

PHP offers different kinds of inbuilt functions having distinctive functionalities. The substr() is a built-in function in PHP and this function works with strings. It is utilized to extricate a part of the string .The syntax of the substr() is demonstrated below.substr(string, begin, length)Now let's discuss the Parameters. Three parameters ... Read More

Explain array_intersect() function in PHP.

Alok Prasad

Alok Prasad

Updated on 29-Jun-2020 08:57:27

In this article, we will learn an array_intersect() a predefined PHP array function. This builtin function of PHP is utilized to figure the convergence of at least two arrays. The function is utilized to compare at least two arrays and returns the matches. The function prints just those components of ... Read More

What is Pass By Reference and Pass By Value in PHP?

Alok Prasad

Alok Prasad

Updated on 29-Jun-2020 08:51:12

In this article, we will learn about pass by value and pass by reference in PHP. Now, let’s understand these two concepts in detail.In PHP generally, we followed to pass the arguments to the function with passed by value approach. We are following this practice because if the value of the ... Read More

What is implode() function in PHP?

Alok Prasad

Alok Prasad

Updated on 29-Jun-2020 08:32:01

In this article, learn how to use PHP Implode() function.The Implode() function is a predefined inbuilt PHP function. We can form a string by joining the components of an array with the help of the PHP implode function. The implode() function creates a string from components of an array utilizing ... Read More

Advertisements