PHP Regular Expressions

Regular expressions are nothing more than a string of characters in a particular order. Regular Expressions (“regex” or “RegExp”) are specifically designed text strings that are used to find patterns in text. To generate complex expressions, regular expressions use arithmetic operators like (+,-,). They may assist you with activities such as validating email addresses and … Read more

PHP Form Handling

Form data is collected using the PHP superglobals $_GET and $_POST. PHP Form Handling-Simple HTML Form A simple HTML form with two input boxes and a submit button is shown below: In the above example, when a user fills out the form and clicks the submit button, the information is transferred to a PHP file … Read more

PHP Form Methods

For uploading data some PHP Form Methods are used such as Get or Post. These methods are written as value of method attribute and specifies the HTTP method to be used when submitting the form data. Both GET and POST are treated as $_GET and $_POST. These are superglobals, which means that they are always … Read more

PHP Functions

A function is a block of code that takes more than one input in the form of a parameter, processes it, and then returns a value. There are two types of PHP functions: Built-in Functions User defined functions PHP Functions: Built-in To do a given operation, PHP includes over 1000 built-in functions that may be … Read more

PHP Array

PHP array is a data structure that contains one or more related types of values in a single value. For example if you want to store 500 names then instead of defining different variable for each name its easy to define an array of 500 length. Multiple values can be stored in an array within … Read more

PHP Numeric Array

PHP Numeric Array is an array in which numbers, strings, and any other object can be stored, but their indexes will be represented by numbers. Each element of the array is represented by an index number that begins with 0. PHP Numeric Array Definition There are two ways of defining PHP numeric array: 1. 2. … Read more

PHP Multidimensional Array

The array of arrays in PHP is  known as a multidimensional array. The array’s elements can all be arrays, and they can also contain additional sub-arrays. It enables the storage of tabular data in an array. PHP multidimensional arrays can be expressed as a matrix, with row * column. PHP Multidimensional Array Definition

PHP Array Sorting

An array elements can be sorted alphabetically or numerically, and in either ascending or decreasing order. PHP Array Sorting Functions There are some php functions through which we can sort the arrays. Following are the functions used for php array sorting: Function Description sort() It sorts the array in ascending order rsort() It sorts the array … Read more

Categories PHP

PHP Operators

Operators in PHP are symbols that are used to execute operations on operands. In simple words, php operators are used to perform different operations on variables and their values. For example: In 4+5, + is an operator and 4 and 5 are values. Types of PHP Operators: In php operators are divided into following types: … Read more

Categories PHP

PHP if.. else Statement

In this chapter, we’ll look at how to use PHP if.. else Statement to build decision-making code. PHP Conditional Statements: Conditional statements are used to do various actions in response to various conditions. When writing code, it’s common to take multiple actions depending on the situation. To accomplish this, you can utilize conditional statements in … Read more

Categories PHP