3v4l.org

run code in 200+ php & hhvm versions
Bugs & Features
<?php function multiID($n=32) { for ($x=$s=0,$r=null; $x<$n; $x++) { $c = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz01234567890'; if (($x<$n) && ($x > 0) && ($s < 2)) { $c .= '-_'; } $g = substr($c, mt_rand(0, strlen($c) - 1), 1); $r .= $g; if (($g == '_') || ($g == '-')) { $s++; } } return $r; } echo multiID(6);
Output for 7.2.0
5izWu_
Output for 7.1.7
VQ0M04
Output for 7.1.6
n_iTyI
Output for 7.1.5
84LemL
Output for 7.1.0
cX0sma
Output for 7.0.20
rQ9Jg-
Output for 7.0.14
U_c4r3
Output for 7.0.6
9LcYQZ
Output for 7.0.5
i4q7vz
Output for 7.0.4
pNStf3
Output for 7.0.3
AqrsPR
Output for 7.0.2
wo4mwJ
Output for 7.0.1
qhGX8Q
Output for 7.0.0
i_5Vq0
Output for 5.6.28
wSa0vm
Output for 5.6.21
ceV_fL
Output for 5.6.20
l5W2av
Output for 5.6.19
AWbC23
Output for 5.6.18
bT7ALy
Output for 5.6.17
vfvliG
Output for 5.6.16
fTlIKp
Output for 5.6.15
0wnQhn
Output for 5.6.14
k5uEZ9
Output for 5.6.13
BwpSdk
Output for 5.6.12
rC6-U9
Output for 5.6.11
ljIPRu
Output for 5.6.10
C6ya_0
Output for 5.6.9
QurggZ
Output for 5.6.8
ogpDoR
Output for 5.5.35
YjUrXq
Output for 5.5.34
EuxahA
Output for 5.5.33
lM3UOZ
Output for 5.5.32
fTk68F
Output for 5.5.31
jMk4Om
Output for 5.5.30
ROJZO0
Output for 5.5.29
tPCX5O
Output for 5.5.28
946cxK
Output for 5.5.27
j_4fdh
Output for 5.5.26
L3B3Lc
Output for 5.5.25
P22VNu
Output for 5.5.24
ra0330
Output for 5.4.45
yfmTyR
Output for 5.4.44
y0R9KL
Output for 5.4.43
MWy2FM
Output for 5.4.42
EXiaeT
Output for 5.4.41
N_xGOk
Output for 5.4.40
48pXOc
Output for 5.4.39
pKtiQa
Output for 5.4.38
AthypV
Output for 5.4.37
8enczT
Output for 5.4.36
0o_SFU
Output for 5.4.35
nMyB6H
Output for 5.4.34
31Jqzt
Output for 5.4.32
ML_5WI
Output for 5.4.31
aJDM9-
Output for 5.4.30
A71w0K
Output for 5.4.29
BYT4VN
Output for 5.4.28
MHRWIZ
Output for 5.4.27
Zwgf2O
Output for 5.4.26
G0qAY6
Output for 5.4.25
o-U31H
Output for 5.4.24
Dk908W
Output for 5.4.23
osVLAN
Output for 5.4.22
3N-N0c
Output for 5.4.21
5yoXiA
Output for 5.4.20
8spBwG
Output for 5.4.19
4l3FZ3
Output for 5.4.18
3n0UkD
Output for 5.4.17
OLG5zC
Output for 5.4.16
kY3j0M
Output for 5.4.15
GKoRpn
Output for 5.4.14
CS7FJ9
Output for 5.4.13
xi2XNg
Output for 5.4.12
pH-gYL
Output for 5.4.11
dD00m8
Output for 5.4.10
NEEY0d
Output for 5.4.9
ckjf-3
Output for 5.4.8
FThdm-
Output for 5.4.7
FWkxSm
Output for 5.4.6
zsmCLe
Output for 5.4.5
Yrax4p
Output for 5.4.4
bxZtgN
Output for 5.4.3
aE0Gf8
Output for 5.4.2
GoF8pN
Output for 5.4.1
xAeYfM
Output for 5.4.0
iXAt6G
Output for 5.3.29
WyGYHy
Output for 5.3.28
0JOmbn
Output for 5.3.27
2eW7n7
Output for 5.3.26
TyDTzp
Output for 5.3.25
sNXSR1
Output for 5.3.24
76nroA
Output for 5.3.23
91gWVq
Output for 5.3.22
DfA3oC
Output for 5.3.21
N4P1Ad
Output for 5.3.20
7UPQ0H
Output for 5.3.19
hKgdTj
Output for 5.3.18
IYDjls
Output for 5.3.17
0ZIdHV
Output for 5.3.16
wes--m
Output for 5.3.15
cTWI_6
Output for 5.3.14
QL3gXl
Output for 5.3.13
bTwkiU
Output for 5.3.12
k7021_
Output for 5.3.11
ajCIVK
Output for 5.3.10
3lTAdM
Output for 5.3.9
rFCX8O
Output for 5.3.8
L_dvmM
Output for 5.3.7
mkq6sn
Output for 5.3.6
M1cWy7
Output for 5.3.5
DcW01Z
Output for 5.3.4
nHQxvF
Output for 5.3.3
DLovF3
Output for 5.3.2
9C1Iqq
Output for 5.3.1
j-fgjG
Output for 5.3.0
jGbkjB
Output for 5.2.17
gNHwT2
Output for 5.2.16
QYhauk
Output for 5.2.15
FEkTk8
Output for 5.2.14
5bXJN5
Output for 5.2.13
ExqR0k
Output for 5.2.12
thidFa
Output for 5.2.11
1SJTwE
Output for 5.2.10
9FMrnP
Output for 5.2.9
dEyqeK
Output for 5.2.8
z00IvF
Output for 5.2.7
fbCoSL
Output for 5.2.6
u1UREp
Output for 5.2.5
j8ZMQf
Output for 5.2.4
CZXlEd
Output for 5.2.3
BXzOCB
Output for 5.2.2
4Wlwz1
Output for 5.2.1
OwnBBn
Output for 5.2.0
HpmECj
Output for 5.1.6
EMHd5g
Output for 5.1.5
G0dumY
Output for 5.1.4
dZ7qu1
Output for 5.1.3
NgS0j9
Output for 5.1.2
fOOCFC
Output for 5.1.1
zi9J9V
Output for 5.1.0
DbVIPn
Output for 5.0.5
26F1xj
Output for 5.0.4
OPANJz
Output for 5.0.3
48pQe0
Output for 5.0.2
7pT31N
Output for 5.0.1
czLHA0
Output for 5.0.0
o3V5sB
Output for 4.4.9
JdLmhC
Output for 4.4.8
mMFY8j
Output for 4.4.7
mjLb4v
Output for 4.4.6
H4To8u
Output for 4.4.5
x1FYSX
Output for 4.4.4
LgY1I3
Output for 4.4.3
fC9ABo
Output for 4.4.2
SSSOUV
Output for 4.4.1
2Rc-i7
Output for 4.4.0
ADnD7a
Output for 4.3.11
PdMys0
Output for 4.3.10
mz3GSR
Output for 4.3.9
jHi0cT
Output for 4.3.8
gtWrg0
Output for 4.3.7
4F0HOT
Output for 4.3.6
eW7LOa
Output for 4.3.5
YWqWHa
Output for 4.3.4
Q_Jl-6
Output for 4.3.3
xg1uHJ
Output for 4.3.2
ufp_J8
Output for 4.3.1
sNY0nL
Output for 4.3.0
MPw0r0