Home
PHP
Chart
Class
Components
Cookie Session
Data Structure
Data Type
Date
Design Patterns
Development
DNS
Email
File Directory
Form
Functions
Graphics Image
HTML
Language Basics
Login Authentication
Math
MySQL Database
Network
Operator
PDF
Reflection
Statement
String
Utility Function
Web Services SOAP WSDL
XML
mt_rand « Math « PHP
PHP
Math
mt_rand
1.
int mt_rand ( [int min, int max] ) returns random numbers, similar to the rand( ).
2.
Finding a random line of a file
3.
Generate random floating-point values from 0 to 10 with two decimals
4.
Generate random numbers
5.
Get a random value from 5 to 25.
6.
Generate Password()
7.
Get random values from –10 to 10.
8.
Random floating-point values from 0 to 10 with two decimals
9.
Random numbe with precision
10.
Random values are not restricted to positive integers. The following example shows how to get random values from -10 to 10.