Blog

python tutorials and learn python

Created with Sketch.

PHP array_pop

PHP array_pop Summary: in this tutorial, you will learn how to use the PHP array_pop() function to remove an element from the end of an array. Introduction to the PHP array_pop() function The array_pop() function removes an element from the end of an array and returns that element. Here’s the syntax of the array_pop() function:…
Read more

PHP array_push

PHP array_push Summary: in this tutorial, you will learn how to add an element to the end of an array by using the PHP array_push() function. Introduction to the PHP array_push() function The array_push() function adds one or more elements to the end of an array. The syntax of the array_push() function is as follows:…
Read more

PHP array_unshift

PHP array_unshift Summary: in this tutorial, you will learn how to use the PHP array_unshift() function to prepend one or more elements to the beginning of an array. Introduction to the PHP array_unshift() function To prepend one or more elements to an array, you use the array_unshift() function: array_unshift ( array &$array , mixed …$values…
Read more

PHP Multidimensional Array

PHP Multidimensional Array Summary: in this tutorial, you will learn how to define a PHP multidimensional array and manipulate its elements effectively. Introduction to PHP multidimensional array Typically, you have an array with one dimension. For example: <?php $scores = [1, 2, 3, 4, 5]; Code language: HTML, XML (xml) Or <?php $rates = […
Read more

PHP foreach

PHP foreach Summary: in this tutorial, you will learn how to use PHP foreach statement to loop over elements of an array. Introduction to the PHP foreach statement PHP provides you with the foreach statement that allows you to iterate over elements of an array, either an indexed array or an associative array. The foreach…
Read more

PHP Associative Arrays

PHP Associative Arrays Summary: in this tutorial, you will learn about PHP associative arrays and how to use them effectively. Introduction to the PHP Associative Arrays Associative arrays are arrays that allow you to keep track of elements by names rather than by numbers. Creating associative arrays To create an associative array, you use the…
Read more

PHP Array

PHP Array Summary: in this tutorial, you’ll learn about PHP arrays and how to manipulate array elements effectively. Introduction to PHP arrays By definition, an array is a list of elements. So, for example, you may have an array that contains a list of products. PHP provides you with two types of arrays: indexed and…
Read more

PHP Variadic Functions

PHP Variadic Functions Summary: in this tutorial, you’ll learn about the PHP variadic functions that accept a variable number of arguments. Introduction to the PHP variadic functions So far, you’ve learned how to define functions that accept a fixed number of parameters. A variadic function accepts a variable number of parameters. The following example defines…
Read more

PHP strict_types

PHP strict_types Summary: in this tutorial, you’ll learn how to enable strict typing using the PHP strict_types directive. Introduction to the PHP strict typing Type hints allow you to declare types for function parameters and return values. For example: <?php function add(int $x, int $y) { return $x + $y; } echo add(1.5, 2.5); //…
Read more

PHP Type Hints

PHP Type Hints Summary: in this tutorial, you’ll learn how to use PHP type hints to declare the types for function parameters and return values. Introduction to PHP type hints PHP is a dynamically typed language. When you define a function, you don’t need to declare types for parameters. For example: <?php function add($x, $y)…
Read more