Alok Prasad has Published 38 Articles

How to convert XML file into array in PHP?

Alok Prasad

Alok Prasad

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

2K+ Views

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

4K+ Views

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

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

Alok Prasad

Alok Prasad

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

6K+ Views

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

Compare define() vs const in PHP

Alok Prasad

Alok Prasad

Updated on 31-Dec-2019 10:10:49

5K+ Views

As we know both define() and const are used to declare a constant in PHP script.SyntaxLet's discuss the difference between these two.The basic difference between these two is that const defines constants at compile time, whereas define() defines them at run time.We can't use the const keyword to declare constant ... Read More

Comparison between "&&" and "AND" operator in PHP.

Alok Prasad

Alok Prasad

Updated on 31-Dec-2019 09:28:32

523 Views

PHP offers incredible operators to perform operations such as arithmetic, assignment, comparison and many more ...In this article, more importance will be laid on logical operators "&&" and "AND" and will study how they can be utilized based on their precedence. Logical operators "&&" and "AND" produce true-or-false as results, ... Read More

What are getters and setters methods in PHP?

Alok Prasad

Alok Prasad

Updated on 31-Dec-2019 08:57:06

15K+ Views

In this article, we learn the best way to create getter and setter strategies in PHP. Getter and setter strategies are utilized when we need to restrict the direct access to the variables by end-users. Getters and setters are methods used to define or retrieve the values of variables, normally ... Read More

What is "namespace" keyword in PHP?

Alok Prasad

Alok Prasad

Updated on 31-Dec-2019 08:53:49

369 Views

In this article, we are going to learn about namespace in PHP. In PHP when we are creating large applications or when integrating third-party applications/library then there may be chances of collision between class names, function names. So to avoid these problems PHP "Namespaces" provide a way in which to ... Read More

What is method overloading in PHP?

Alok Prasad

Alok Prasad

Updated on 31-Dec-2019 08:29:38

10K+ Views

Method Overloading is a concept of Object Oriented Programming which helps in building the composite application in an easy way. Function overloading or method overloading is a feature that permits making creating several methods with a similar name that works differently from one another in the type of the input ... Read More

Explain difference between Abstraction and Encapsulation in PHP.

Alok Prasad

Alok Prasad

Updated on 31-Dec-2019 08:20:07

1K+ Views

PHP5 added the object-oriented programming approach with the previous version, which is used for making code reusable in real time php application.Some of the concepts of object-oriented models are: class, object, encapsulation, polymorphism, abstract and final classes, and methods, interfaces and inheritance, etc...Here we discuss the basic differences between abstraction ... Read More

Explain STATIC AND INSTANCE method in PHP.

Alok Prasad

Alok Prasad

Updated on 31-Dec-2019 08:18:24

720 Views

In PHP, instance methods are the preferable practice over static methods. In any case, it isn't to say that static methods are not helpful, they have a distinct and unique purpose. Here we discuss a comparison between static and instance methods in PHP.Here Note that instance method is always connected ... Read More

Advertisements