Skip to content
This repository was archived by the owner on Oct 12, 2023. It is now read-only.

Commit a5922af

Browse files
committed
Initial commit
1 parent 1f0879d commit a5922af

File tree

4 files changed

+94522
-0
lines changed

4 files changed

+94522
-0
lines changed

README.md

Lines changed: 164 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,164 @@
1+
# PHP Random Name Generator
2+
3+
PHP class capable of generating millions of random name combinations (first names and surnames) for use as demo data in applications and other projects.
4+
5+
## Requirements
6+
7+
PHP 5.3+
8+
9+
## Usage
10+
11+
Upload the the php-random-name-generator folder to your desired location and include the class:
12+
13+
```
14+
include 'php-random-name-generator/randomNameGenerator.php';
15+
```
16+
17+
Inititate the class and set the output format. Available output formats are 'array', 'associative_array' and 'json'. If no output is specified, an array will be used. See below for a sample output for each.
18+
19+
```
20+
$r = new randomNameGenerator('array');
21+
```
22+
23+
Generate the names by passing the number of names you want to create:
24+
25+
```
26+
$names = $r->generateNames(10);
27+
```
28+
29+
Now you can iterate through the data and create user accounts or do whatever you want with it (don't be evil).
30+
31+
### Sample Outputs
32+
33+
#### JSON
34+
35+
```
36+
[
37+
{
38+
"first_name": "Fernande",
39+
"last_name": "Hauer"
40+
},
41+
{
42+
"first_name": "Erlinda",
43+
"last_name": "Thiel"
44+
},
45+
{
46+
"first_name": "Elena",
47+
"last_name": "Soleman"
48+
},
49+
{
50+
"first_name": "Hiroko",
51+
"last_name": "Froncillo"
52+
},
53+
{
54+
"first_name": "Jordon",
55+
"last_name": "Buehring"
56+
},
57+
{
58+
"first_name": "Verlie",
59+
"last_name": "Coelho"
60+
},
61+
{
62+
"first_name": "Amos",
63+
"last_name": "Wernecke"
64+
},
65+
{
66+
"first_name": "Chasidy",
67+
"last_name": "Jaskolski"
68+
},
69+
{
70+
"first_name": "Dollie",
71+
"last_name": "Estrem"
72+
},
73+
{
74+
"first_name": "Noma",
75+
"last_name": "Mends"
76+
}
77+
]
78+
```
79+
80+
#### Array
81+
82+
```
83+
Array
84+
(
85+
[0] => Stacee Scheiderer
86+
[1] => Ambrose Sens
87+
[2] => Quinton Spratte
88+
[3] => Jolie Kapsalis
89+
[4] => Barbra Krawiec
90+
[5] => Phylicia Eikmeier
91+
[6] => Walton Chalfin
92+
[7] => Letha Prakash
93+
[8] => Tu Grenke
94+
[9] => Brunilda Kirstein
95+
)
96+
```
97+
98+
#### Associative Array
99+
100+
```
101+
Array
102+
(
103+
[0] => Array
104+
(
105+
[first_name] => Annabel
106+
[last_name] => Mapa
107+
)
108+
109+
[1] => Array
110+
(
111+
[first_name] => Claire
112+
[last_name] => Iovino
113+
)
114+
115+
[2] => Array
116+
(
117+
[first_name] => Agripina
118+
[last_name] => Gillig
119+
)
120+
121+
[3] => Array
122+
(
123+
[first_name] => Kathern
124+
[last_name] => Strausbaugh
125+
)
126+
127+
[4] => Array
128+
(
129+
[first_name] => Delbert
130+
[last_name] => Whitescarver
131+
)
132+
133+
[5] => Array
134+
(
135+
[first_name] => Marlon
136+
[last_name] => Botz
137+
)
138+
139+
[6] => Array
140+
(
141+
[first_name] => Patrice
142+
[last_name] => Baller
143+
)
144+
145+
[7] => Array
146+
(
147+
[first_name] => Teodora
148+
[last_name] => Semmes
149+
)
150+
151+
[8] => Array
152+
(
153+
[first_name] => Billy
154+
[last_name] => Hruby
155+
)
156+
157+
[9] => Array
158+
(
159+
[first_name] => Sammy
160+
[last_name] => Hess
161+
)
162+
163+
)
164+
```

0 commit comments

Comments
 (0)