
One of the simplest ways PHP has to create a loop or repeat a block of code while a condition is met is while, and we can also use do-while to go through the block at least once.
Leer mas..
In this section, we will see the different ways to use the PHP if statement. This control structure allows us to execute code depending on a condition. In the following sections, we will refer to this condition as an expression. Expressions can be formed with comparison and logical operators to obtain a boolean result. if […]
Leer mas..
Sometimes we want to compare the same variable with different values, and that’s where the PHP switch statement comes in. In the following example, we compare the variable $i with the values 0, 1, 2. switch ($i) { case 0: echo "i es 0"; break; case 1: echo "i es 1"; break; case 2: echo […]
Leer mas..
PHP unlink fulfills the function of deleting a file.
Leer mas..
The PHP function str_replace will replace all occurrences of a given text or texts ($search) in a string ($subject) or array of strings with a string given as a parameter/s ($replace).
Leer mas..