PHP uses four directives that can be used to include another PHP file in a currently running script.
Category: PHP
PHP is a scripting language that’s usually embedded or combined with HTML and has many excellent libraries that provide fast, customized access to DBMSs.
Variable Scope
How to use use variables declared outside the function?
Arrow and Anonymous Functions
In this tutorial we’ll use and compare anonymous and arrow functions.
Passing variables by reference to a function
By default, variables are passed to functions by value. To pass variables by reference, prefix the variable with & (ampersand) character: &$var. Referencing with the ampersand can also be used when assigning variables.
Defining Functions
User-defined functions help you create organized and reusable code. They provide a way to group together related statements into a cohesive block. For reusable code, a function saves duplicating statements and makes maintenance of the code easier.
PHP provides the following functions that convert numbers between integer decimal and the commonly used number systems, binary, octal, and hexadecimal.
Generating a random number
PHP provides the rand( ) and mt_rand() functions, which returns values from a generated sequence of pseudo-random numbers. The srand( ) and mt_srand() functions seed the algorithm and need to be called before the first use of the rand( ) or mt_rand() functions in a script to return the same random numbers each time a script is called.
Ceil, Floor, and Round
Rounding float values up or down with ceil, floor, and round functions.
Find absolute, lowest, or highest value
How to find the absolute value of a number and find the minimum or maximum value from a set of mixed values.
The DatePeriod Class
Learn how to generate date or time ranges with the help of DatePeriod class.