Blog

python tutorials and learn python

Created with Sketch.

PHP Cookies

PHP Cookies Summary: in this tutorial, you’ll learn about cookies and how to use the PHP setcookie() function to manage cookies effectively. Introduction to cookies The web works based on the HTTP protocol. The HTTP protocol is stateless. When the web browser requests a page from a web server, the webserver responds with the page…
Read more

PHP Variable Variables

PHP Variable Variables Summary: in this tutorial, you’ll learn about PHP variable variables and how to apply them effectively. Introduction to the PHP variable variables Typically, you have a variable with a predefined name. For example, the following defines a variable with the name $title that holds a string. <?php $title = ‘PHP variable variables’;…
Read more

How to Use the PHP __DIR__ to Include a File

PHP __DIR__ Summary: in this tutorial, you’ll learn about how to use the PHP __DIR__ magic constant when including a PHP file. Introduction to the PHP __DIR__ magic constant PHP 5.3 introduced a new magic constant called __DIR__. When you reference the __DIR__ inside a file, it returns the directory of the file. The __DIR__…
Read more

PHP require

PHP require Summary: in this tutorial, you will learn how to use the PHP require construct to load the code from a file into the current script. Introduction to the PHP require construct PHP require construct loads the code from an file into a script and executes that code. The following shows the syntax of…
Read more

PHP include_once

PHP include_once Summary: in this tutorial, you will learn how to use the PHP include_once construct to include a file once. Introduction to the PHP include_once construct In the include tutorial, you learned how to load the code from another file using the include construct. Sometimes, you may have a file that is included more…
Read more

PHP Include

PHP Include Summary: in this tutorial, you will learn how to include code from a file using the PHP include construct. Introduction to the PHP include construct The include construct allows you to load the code from another file into a file. Here’s the syntax of the include construct: include ‘path_to_file’; Code language: PHP (php)…
Read more

PHP array_reduce

PHP array_reduce Summary: in this tutorial, you will learn how to use the PHP array_reduce() function to reduce an array to a single value. Introduction to the PHP array_reduce function The array_reduce() function reduces an array to a single value using a callback function. It’s easier to understand the array_reduce() function by example. The following…
Read more

PHP array_filter Function

PHP array_filter Function Summary: in this tutorial, you’ll learn how to use the PHP array_filter() function to filter elements of an array using a callback function. Introduction to PHP array_filter() function When you want to filter elements of an array, you often iterate over the elements and check whether the result array should include each…
Read more

PHP array_map

PHP array_map Summary: in this tutorial, you will learn how to use the PHP array_map() function that creates a new array whose elements are the results of applying a callback to each element. Introduction to the PHP array_map() function Suppose that you have an array that holds the lengths of squares: <?php $lengths = [10,…
Read more

PHP is_null

PHP is_null Summary: in this tutorial, you’ll learn how to use the PHP is_null() construct to check if a variable is null. Introduction to the PHP is_null() construct PHP is_null() accepts a variable and returns true if that variable is null. Otherwise, it returns false. is_null(mixed $v): bool Code language: PHP (php) In this syntax,…
Read more