Tag Archives: PHP-basics

The Bitwise operators is used to perform bit-level operations on the operands. The operators are first converted to bit-level and then calculation is performed on… Read More
In a production level code it is very important to keep information as either variables or constants rather than using them explicitly. A PHP constant… Read More
A number is called even if the number is divisible by 2 and is called odd if it is not divisible by 2. Given a… Read More
The Fibonacci series is a series of elements where, the previous two elements are added to get the next element, starting with 0 and 1.… Read More
We already know how to get the factorial of a number in other languages. Let’s see how this is done in PHP using both recursive… Read More
This is a simple PHP program where we need to calculate the sum of all digits of a number. Examples: Input : 711 Output :… Read More
Arrays in PHP is a type of data structure that allows us to store multiple elements of similar data type under a single variable thereby… Read More
Constants are either identifiers or simple names that can be assigned any fixed values. They are similar to a variable except that they can never… Read More
Strings can be seen as a stream of characters. For example, ‘G’ is a character and ‘GeeksforGeeks’ is a string. We have learned about basics… Read More
PHP follows few rules and maintains its style of coding. As there are many coders and developers all over the world, so each of them… Read More
A function is a block of code written in a program to perform some specific task. We can relate functions in programs to employees in… Read More
Like any other language, loop in PHP is used to execute a statement or a block of statements, multiple times until and unless a specific… Read More
PHP allows us to perform actions based on some type of conditions that may be logical or comparative. Based on the result of these conditions… Read More
Operators are used to perform operations on some values. In other words, we can describe operators as something that takes some values, performs some operation… Read More
Data Types defines the type of data a variable can store. PHP allows eight different types of data types. All of them are discussed below.… Read More