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.
Author: BrainBell
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.
The DateInterval Class
How to add or subtract a date/time period from a DateTime object using the add() and sub() methods.
The DateTimeZone Class
This tutorial describes how to represent times in different parts of the world.
The DateTime Class
The DateTime class deals with a wide range of date and time calculations, it provides an object-oriented interface to accurately create and manipulate dates and times.
Calculating Dates
Learn how to calculate the difference between two date and time strings. Also, how to find the leap year from a list of years.