Authoradmin

Access Modifiers in PHP

A

Like other languages, PHP also implements some scope for the methods or attributes of the class. Access modifiers define where the class variables or methods can be accessed. In this article, you will learn about the access modifiers in PHP OOP and their types. Types of Access Modifiers in PHP There are three access modifiers in PHP. Public – When you create a method or attribute in the PHP...

Constructor and Destructor in PHP

C

In the previous article, we have covered the basic concepts of a class and objects. In this PHP tutorial, you will learn constructor and destructor in the PHP class. What is a Constructor and Destructor in PHP class? Constructor As the name suggests, a construct constructs an object. The real definition of a constructor is, it initializes the object of the class. How to declare the constructor in...

OOP in PHP – Introduction to Class and Objects

O

In the previous tutorials, we used functions to write PHP scripts. Therefore, it is called structural programming. But, structural programming becomes more messy and difficult to understand and handle as the size of the application or project increases. We are now starting Object Oriented Programming- OOP in PHP that makes use of classes and objects. What is Object-Oriented Programming –...

Regex in PHP

R

What is a Regular Expression? The regular expression is basically started from mathematics which defines a range of characters for some purpose. Different languages get references from this mathematical concept and applied it for searching patterns and validation of data. In this article, you will learn regex in PHP. There are many use cases of regex in PHP like searching, validating, etc. In...

PHP JSON and Callback functions

P

In this article, you will learn about JSON format and its available PHP functions. Also, we will look at the Callback functions in PHP. So, let’s start. What is JSON? JSON stands for Javascript Object Notation. It is a structure to represent the data in a more readable form. JSON is used all over the world by almost all languages, therefore it plays an important role in making cross...

PHP Filters -Validation and Sanitization

P

In this article, you will learn some useful PHP topics as per title, Filters, and Callback functions. Let’s start with the filters. PHP Filters PHP filters are used to sanitize and validate the input data. Sanitization: To Remove any illegal characters from the input data. Validation: Process of determining if the input data is in proper form. PHP filters make sure sanitization and...

PHP Sessions and Cookies

P

Web pages need to store the data temporarily or permanently to perform the request and response operations successfully. Almost every web development language provides sessions and cookies to store the client and server information. It is responsible for smooth experience and security. In this PHP tutorial, you will learn about PHP sessions and cookies. So, let’s dive into it. What are...

File Handling in PHP

F

File handling is an important part of any application whether it’s a desktop application or a web-based application. As we are learning web development using PHP, so in this tutorial, we will learn file handling in PHP. How to read file in PHP? PHP provides fopen() method to open and read file contents. Fopen() function is alternative of php readfile() function and is loaded with more...

Request Method in PHP and Super Globals in PHP

R

What is HTTP? In this tutorial, you will learn the HTTP request method in PHP. Hypertext Transfer Protocol (HTTP) is a client and server communication protocol. It enables the communication between server and client using the request-response protocol. For instance, the client sends a request to the server and the server return response that contains a status code along with request information...

PHP Array Sorting and useful functions

P

In the previous tutorial on PHP Arrays. We have learned about declaring and iterating indexed, associative, and multi-dimensional arrays. We are now in a position to dig deeper into PHP Array Sorting. Besides this, we will also work with useful functions that really make working with arrays super easy. Array Sorting functions in PHP In PHP 8, we have the following functions to sort an array...

Tutor Network