Category: PHP Tutorial

python tutorials and learn python

Created with Sketch.

PHP Arrow Functions

PHP Arrow Functions Summary: in this tutorial, you will learn about PHP arrow functions and how to use them effectively. Introduction to PHP arrow functions PHP 7.4 introduced the arrow functions that provide a more concise syntax for the anonymous functions. The following illustrates the basic syntax for arrow functions: fn (arguments) => expression; Code…
Read more

PHP Anonymous Functions

PHP Anonymous Functions Summary: in this tutorial, you will learn about PHP anonymous functions and how to use them effectively. Introduction to anonymous functions When you define a function, you specify a name for it. Later, you can call the function by its name. For example, to define a function that multiplies two numbers, you…
Read more

PHP uksort

PHP uksort Summary: in this tutorial, you’ll learn how to use the PHP uksort() function to sort an array by keys using a user-defined comparison function. Introduction to the PHP uksort() function The uksort() function allows you to sort an array by key using a user-defined comparison function. Typically, you use the uksort() function to…
Read more

PHP uasort

PHP uasort Summary: in this tutorial, you’ll learn how to use the PHP uasort() function to sort an associative array. Introduction to the PHP uasort() function The uasort() function sorts the elements of an associative array with a user-defined comparison function and maintains the index association. The following shows the syntax of the uasort() function:…
Read more

PHP asort

PHP asort Summary: in this tutorial, you’ll learn how to use the PHP asort() function to sort an associative array and maintain the index association. Introduction to the PHP asort() function The asort() function sorts the elements of an associative array in ascending order. Unlike other sort functions, the asort() function maintains the index association.…
Read more

PHP usort

PHP usort Summary: in this tutorial, you’ll learn how to use the PHP usort() function to sort an array using a user-defined comparison function. Introduction to the PHP usort() function So far, you learned how to sort an array using a built-in comparison operator. For example, when you use the sort() function to sort an…
Read more

PHP ksort

PHP ksort Summary: in this tutorial, you’ll learn how to use the PHP ksort() function to sort the keys of an associative array. Introduction to the PHP ksort() fucntion The ksort() function sorts the elements of an array by their keys. The ksort() is mainly useful for sorting associative arrays. The following shows the syntax…
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 Array Destructuring

PHP Array Destructuring Summary: in this tutorial, you’ll learn how to use PHP array destructuring to assign elements of an array to multiple variables. Introduction to the PHP array destructuring Suppose that you have an array returned by a function parse_url(): <?php $urls = parse_url(‘https://www.python-tutorials.in/’); var_dump($urls); Code language: PHP (php) Output: array(3) { [“scheme”]=> string(5)…
Read more

PHP list

PHP list Summary: in this tutorial, you’ll learn how to use the PHP list syntax to assign multiple variables in one operation. Introduction to the PHP list syntax Suppose you have an array that contains two numbers: <?php $prices = [100, 0.1]; Code language: PHP (php) To assign each element of the $prices array to…
Read more