Floor
Rounding (rounding down)
Float Floor (float $value);
"); Echo (Floor (0.40)."
"); Echo (Floor (5)."
"); Echo (Floor (5.1)."
"); Echo (Floor (-5.1)."
"); Echo (Floor (-5.9)."
")?>
Ceil
Rounding (rounding up)
float ceil (float $value);
"); Echo (Ceil (0.40)."
"); Echo (Ceil (5)."
"); Echo (Ceil (5.1)."
"); Echo (Ceil (-5.1)."
"); Echo (Ceil (-5.9)."
")?>
Max
Take maximum value
Mixed Max (mixed $value, mixed $value, ...);
"); Echo (Max ( -3,5)."
"); Echo (Max ( -3,-5)."
"); Echo (Max (7.25,7.30)."
");? >
Min
Take the minimum value
Mixed min (mixed $value, mixed $value, ...);
"); Echo (min ( -3,5)."
"); Echo (min ( -3,-5)."
"); Echo (min (7.25,7.30)."
");? >
Pow
Power operation
Number POW (number $base, number $expr);
"; Echo Pow (6,2)."
"; Echo Pow ( -6,2)."
"; Echo Pow ( -6,-2)."
"; Echo Pow ( -6,5.5)."
";? >
sqrt
Take the square root
float sqrt (float $arg)
"; Echo (sqrt (1))."
"; Echo (sqrt (9))."
"; Echo (sqrt (0.64))."
"; Echo (sqrt (-9))."
";? >
Rand
Generate random numbers
int Mt_rand (int $min, int max);
"; Echo rand (10,100)."
";? >
Mt_rand
produce a better random number
int Mt_rand (int $min, int max);
Similar to the above Rand usage and output, this is 4 times times faster than Rand.
Round
Rounded
Float round (float $val [, int $precision = 0])
The second parameter is optional, which specifies the number of decimal places reserved
Number_format
Formatting numbers with thousands grouping
Float Number_format (float $number, int $decimals =0, string $dec _point= ", ', String $thousands _sep= ', ');
Time
Returns the current UNIX timestamp
int time (void);
"; $nextWeek = time () + (7 * 24 * 60 * 60); 7 days; Hours; mins; 60secsecho ' Now: '. Date (' y-m-d '). "
Echo ' Next Week: '. Date (' y-m-d ', $nextWeek). "
";? >
Date
Format a local time/date
String Date (string format[, int timestamp]);
GetDate
Get Date/Time information
Array getdate ([int timestamp]);
MD5 Hash
String MD5 (string $str [, bool $raw _output=false]);
Strpos
Returns the position of the first occurrence of a character in another character
int Strpos (String haystack, mixed needle[, int offset]);