Blog

python tutorials and learn python

Created with Sketch.

PHP switch

PHP switch Summary: in this tutorial, you will learn about the PHP switch statement that executes a code block by matching an expression with multiple values. Introduction to the PHP switch statement When the value of a single variable determines the number of different choices, you can use the if…elseif statement. Suppose that you’re building…
Read more

PHP Ternary Operator

PHP Ternary Operator Summary: in this tutorial, you will learn to use the PHP ternary operator to make the code shorter and more readable. Introduction to the PHP ternary operator The ternary operator is a shorthand for the if…else statement. Instead of writing this: <?php if (condition) { $result = value1; } else { $result…
Read more

PHP if elseif

PHP if elseif Summary: in this tutorial, you’ll learn about the PHP if elseif statement to execute code blocks based on multiple boolean expressions. Introduction to the PHP if elseif statement The if statement evaluates an expression and executes a code block if the expression is true: <?php if (expression) { statement; } Code language:…
Read more

PHP if else

PHP if else Summary: in this tutorial, you’ll learn about the PHP if…else statement that executes a code block when a condition is true or another code block when the condition is false. Introduction to PHP if-else statement The if statement allows you to execute one or more statements when an expression is true: <?php…
Read more

PHP if

PHP if Summary: in this tutorial, you’ll learn about the PHP if statement and how to use it to execute a code block conditionally. Introduction to the PHP if statement The if statement allows you to execute a statement if an expression evaluates to true. The following shows the syntax of the if statement: <?php…
Read more

PHP Operators

PHP Operators Summary: in this tutorial, you will learn about PHP operators and how to use them effectively in your script. An operator takes one or more values, known as operands, and performs a specific operation on them. For example, the + operator adds two numbers and returns the sum of them. PHP supports many…
Read more

PHP NOT operator

PHP NOT operator Summary: in this tutorial, you will learn how to use the PHP NOT operator (!) to build complex logical expressions. Introduction to the PHP NOT operator Unlike the logical AND and OR operators that accept two operands, the logical NOT operator accepts only one operand and negates the operand. In other words,…
Read more

PHP OR Operator

PHP OR Operator Summary: in this tutorial, you’ll learn about the PHP OR operator (||) and how to use it to build complex logical expressions. Introduction to the PHP OR operator The logical OR operator accepts two operands and returns true if either operand is true; otherwise, it returns false. In other words, the logical…
Read more

PHP AND Operator

PHP AND Operator Summary: in this tutorial, you’ll learn about the PHP AND operator and how to use it to build a complex logical expression. Introduction to the PHP AND operator The logical AND operator accepts two operands and returns true if both operands are true; otherwise, it returns false. PHP uses the and keyword…
Read more

PHP Comparison Operators

PHP Comparison Operators Summary: in this tutorial, you will learn how to use PHP comparison operators to compare two values. Introduction to PHP comparison operators A comparison operator allows you to compare two values and returns true if the comparison is truthful and false otherwise. The following table illustrates the comparison operators in PHP: Operator…
Read more