PHP while and do-while statements

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.

read more
PHP if statement

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 […]

read more
PHP switch statement 

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 […]

read more
PHP unlink function

PHP unlink fulfills the function of deleting a file.

read more
PHP trim function

Today we will see PHP trim which does this function where I can use it. This function removes white space from the beginning and end of a string by default.

read more
PHP pagination

This post will focus more on covering the fundamentals of how pagination is done in a programming language, and, of course, the language we will use is PHP.

read more
PHP array_is_list function

The PHP function array_is_list checks whether the provided array is a list. However, don’t confuse this with the list function. What it means by “a list” is whether the array is indexed and starts at 0. This way, we can use list if the array meets these criteria.

read more
PHP array_count_values function

It counts the number of times a value appears in the provided array and returns an associative array where the keys are the values from the provided array, and the values are the number of times the value appears in the provided array.

read more
PHP count function

We can use the count function on an array to count all its elements. It can also be used on an object, but the object must implement the Countable interface. For example:

read more
PHP array_chunk function

The array_chunk function is responsible for dividing a provided array into chunks or parts. It will return a new array, which will be the one that is divided into segments as the result.

read more

Comments