Static Public Attributes |
static | $_instances = array() |
Detailed Description
Definition at line 20 of file Faker.php.
Member Function Documentation
Faker::bothify |
( |
|
$string | ) |
|
Replaces all occurrences of # with a random number and replaces all occurrences of ? with a random letter
- Parameters
-
string | $string | String you wish to have parsed |
- Returns
- string
- Author
- Caius Durling
Definition at line 126 of file Faker.php.
References lexify(), and numerify().
{
$result = $this->
lexify( $result );
return $result;
}
Replaces all occurrences of ? with a random letter
- Parameters
-
string | $string | String you wish to have parsed |
- Returns
- string
- Author
- Caius Durling
Definition at line 110 of file Faker.php.
References rand_letter().
Referenced by bothify().
{
foreach ( str_split( $string ) as $char ) {
$result[] = str_replace(
'?', $this->
rand_letter(), $char );
}
return join( $result );
}
Faker::numerify |
( |
|
$string | ) |
|
Replaces all occurrences of # with a random number
- Parameters
-
string | $string | String you wish to have parsed |
- Returns
- string
- Author
- Caius Durling
Definition at line 95 of file Faker.php.
References rand_num().
Referenced by bothify().
{
foreach ( str_split( $string ) as $char ) {
$result[] = str_replace(
'#', $this->
rand_num(), $char );
}
return join( $result );
}
Returns a random letter from a to z
- Returns
- string
- Author
- Caius Durling
Definition at line 82 of file Faker.php.
Referenced by lexify().
{
return chr(mt_rand(97, 122));
}
Returns a random number between 0 and 9
- Returns
- integer
- Author
- Caius Durling
Definition at line 71 of file Faker.php.
Referenced by numerify().
{
return mt_rand(0, 9);
}
Faker::random |
( |
& |
$array | ) |
|
|
protected |
Returns a random element from a passed array
- Parameters
-
- Returns
- string
- Author
- Caius Durling
Definition at line 60 of file Faker.php.
{
return $array[mt_rand(0, count($array)-1)];
}
The documentation for this class was generated from the following file:
- common/modules/bulk/extensions/php-faker/Faker.php