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 Numbers

In this chapter we will discuss PHP numbers in detail and also about functions related PHP numbers. PHP Numbers: Integer Integers can only store whole numbers with either positive or negative signs, such as, numbers without a fractional part or a decimal point. Rules for Integer Integer can be a positive or negative whole number. … Read more

Categories PHP

PHP Switch Statement

The switch statement in PHP is used to execute a single statement based on a set of multiple conditions. It’s similar to a PHP if-else-if statement. Syntax: PHP Switch Statement Working: We begin with a single expression n (usually a variable) that is evaluated only once. The value of the expression is then compared to … Read more

Categories PHP

PHP Loops

PHP Loops are used for repeating the same block of code till a specific condition reaches This saves the user time and effort by writing the code only once and by repeating it as many time as needed. Types of PHP Loops There are four types of loop in PHP: Loop Name Description For loop … Read more

Categories PHP

PHP Break and Continue

PHP Break As We have seen in switch case chapter that break statement is used to jump out of switch statement. The break statement is also used to jump out of loop statement. PHP Continue If a stated condition happens, the continue statement breaks one iteration (in the loop) and continues with the following iteration … 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

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 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 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 Comments

PHP comments are not considered part of the code, since the commented code is not visible to the browser. Basically, it helps the developer to write notes about their code which will later on help them to understand the code. These PHP comments are visible to anyone who visit the source code. Uses of PHP Comments: Helps … Read more

Categories PHP