Skip to content

Tag Archives: PHP-basics

Problem: How to use a switch case ‘or’ in PHP? Solution: This can be achieved in 2 ways. They are as follows: Method 1: Without… Read More
Script execution time in PHP is the time required to execute the PHP script. To calculate script execution time use clock time rather than the… Read More
Prerequisite: Types of Error PHP is used for web development. Error handling in PHP is almost similar to error handling in all programming languages. The… Read More
‘AND’ Operator The AND operator is called logical operator. It returns true if both the operands are true. Example: <?php    // Variable declaration and… Read More
Variables Variables in a program are used to store some values or data that can be used later in a program. The variables are also… Read More
The $ operator in PHP is used to declare a variable. In PHP, a variable starts with the $ sign followed by the name of… Read More
Euler’s Number or commonly known as e is a very popular irrational number which approximates to 2.718281828 and is one of the most important mathematical… Read More
Most often we need to store a complex array in the database or in a file from PHP. Some of us might have surely searched… Read More
The hex2bin() function is a built-in function in PHP. The hex2bin() function is used to decode a hexadecimally encoded binary string. That is, it decodes… Read More
The settype() function is a built-in function in PHP. The settype() function is used to the set the type of a variable. It is used… Read More
We have to print an arithmetic progressive series in PHP, between two given numbers a and b both including, with a given common arithmetic difference… Read More
You are given an array of n elements in PHP. You have to separate the elements from the array based on the elements are odd… Read More
You are given an array of strings. You have to change all of the strings present in the given array to uppercase no matter in… Read More
We already have learnt about file inclusion in PHP in the article PHP | (Include and Require). We have discussed about include() and require() functions… Read More
The filter_var() function filters a variable with the specified filter. This function is used to both validate and sanitize the data. Syntax :- filter_var(var, filtername,… Read More