Random
extends AbstractRandom
in package
Simple Random implementation.
Table of Contents
Methods
- address() : string
- Retrieve random address.
- boolean() : bool
- Retrieve random boolean.
- city() : string
- Retrieve random city.
- company() : string
- Retrieve random company.
- country() : string
- Retrieve random country.
- dataProvider() : string
- Retrieve value from data provider.
- date() : string
- Retrieve random date.
- datetime() : string
- Retrieve random datetime.
- department() : string
- Retrieve random department.
- domain() : string
- Retrieve random domain name.
- email() : string
- Retrieve random email.
- float() : float
- Retrieve random float.
- getUrlQuery() : string
- Retrieve random url query.
- integer() : int
- Retrieve random integer.
- mixed() : mixed
- Retrieve random mixed.
- name() : string
- Retrieve random name.
- option() : mixed
- Retrieve one of value from array element.
- phone() : string
- Retrieve random phone.
- postal() : string
- Retrieve random postal.
- product() : string
- Retrieve random product.
- profession() : string
- Retrieve random profession.
- string() : string
- Retrieve random string.
- time() : string
- Retrieve random time.
- timestamp() : int
- Retrieve random timestamp.
- tld() : string
- Retrieve random top level domain.
- url() : string
- Retrieve random url.
- website() : string
- Retrieve random website name.
- word() : string
- Retrieve random word.
- getDataProvider() : array<string|int, string>
- Retrieve values of data provider.
- getUrlPath() : string
- Retrieve random url path.
Methods
address()
Retrieve random address.
public
address() : string
Return values
stringboolean()
Retrieve random boolean.
public
boolean() : bool
Return values
boolcity()
Retrieve random city.
public
city() : string
Return values
stringcompany()
Retrieve random company.
public
company() : string
Return values
stringcountry()
Retrieve random country.
public
country() : string
Return values
stringdataProvider()
Retrieve value from data provider.
public
dataProvider(string $Name[, int $Size = 1 ]) : string
Parameters
- $Name : string
-
The build-in data provider name.
- $Size : int = 1
-
The size of name to return.
Return values
stringdate()
Retrieve random date.
public
date([string|null $From = null ][, string|null $To = null ]) : string
Parameters
- $From : string|null = null
-
The lowest date value.
- $To : string|null = null
-
The highest date value.
Return values
stringdatetime()
Retrieve random datetime.
public
datetime([string|null $From = null ][, string|null $To = null ]) : string
Parameters
- $From : string|null = null
-
The lowest date value.
- $To : string|null = null
-
The highest date value.
Return values
stringdepartment()
Retrieve random department.
public
department() : string
Return values
stringdomain()
Retrieve random domain name.
public
domain() : string
Return values
stringemail()
Retrieve random email.
public
email() : string
Return values
stringfloat()
Retrieve random float.
public
float([float $Min = PHP_FLOAT_MIN ][, float $Max = PHP_FLOAT_MAX ][, int $Precision = 2 ]) : float
Parameters
- $Min : float = PHP_FLOAT_MIN
-
The minimum number.
- $Max : float = PHP_FLOAT_MAX
-
The maximum number.
- $Precision : int = 2
-
The precision number.
Return values
floatgetUrlQuery()
Retrieve random url query.
public
getUrlQuery() : string
Return values
stringinteger()
Retrieve random integer.
public
integer([int $Min = PHP_INT_MIN ][, int $Max = PHP_INT_MAX ]) : int
Parameters
- $Min : int = PHP_INT_MIN
-
The minimum number.
- $Max : int = PHP_INT_MAX
-
The maximum number.
Return values
intmixed()
Retrieve random mixed.
public
mixed() : mixed
name()
Retrieve random name.
public
name([int $Size = 1 ]) : string
Parameters
- $Size : int = 1
-
The size of name to return.
Return values
stringoption()
Retrieve one of value from array element.
public
option([array<string|int, mixed> $Data = [] ]) : mixed
Parameters
- $Data : array<string|int, mixed> = []
-
The options.
phone()
Retrieve random phone.
public
phone() : string
Return values
stringpostal()
Retrieve random postal.
public
postal() : string
Return values
stringproduct()
Retrieve random product.
public
product() : string
Return values
stringprofession()
Retrieve random profession.
public
profession() : string
Return values
stringstring()
Retrieve random string.
public
string([int $Length = 8 ][, string $Characters = "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789-._~+/" ]) : string
Parameters
- $Length : int = 8
-
The character length.
- $Characters : string = "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789-._~+/"
-
The character possibility.
Return values
stringtime()
Retrieve random time.
public
time() : string
Return values
stringtimestamp()
Retrieve random timestamp.
public
timestamp([string|null $From = null ][, string|null $To = null ]) : int
Parameters
- $From : string|null = null
-
The lowest date value.
- $To : string|null = null
-
The highest date value.
Return values
inttld()
Retrieve random top level domain.
public
tld() : string
Return values
stringurl()
Retrieve random url.
public
url() : string
Return values
stringwebsite()
Retrieve random website name.
public
website() : string
Return values
stringword()
Retrieve random word.
public
word([int $Size = 1 ]) : string
Parameters
- $Size : int = 1
-
The size of word to return.
Return values
stringgetDataProvider()
Retrieve values of data provider.
protected
getDataProvider(string $Name) : array<string|int, string>
Parameters
- $Name : string
-
The build-in data provider name.
Return values
array<string|int, string>getUrlPath()
Retrieve random url path.
private
getUrlPath() : string