3v4l.org

run code in 150+ php & hhvm versions
Bugs & Features
<?php function random_string($charcount = 8, $mode = 0, $capsonly = 0) { /* 0 = alphanumeric 1 = letters only 2 = numbers only */ $chars_alpha_cap = 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'; $chars_alpha_low = 'abcdefghijklmnopqrstuvwxyz'; $chars_num = '0123456789'; if ($capsonly) { $chars_alpha_cap = ''; $chars_alpha_low = 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'; } switch ($mode) { case 1: $chars = $chars_alpha_cap . $chars_alpha_low; break; case 2: $chars = $chars_num; break; default: $chars = $chars_alpha_cap . $chars_alpha_low . $chars_num; } $rand = false; for ($i = 0; $i < $charcount; $i++) { $rand .= $chars[mt_rand(0, strlen($chars) - 1)]; } return $rand; } echo random_string(32,0,0);
Output for 7.1.0
NsdCnDiAxIXsOgIxKpsazMXlEwjYxqjo
Output for 7.0.14
tQUOzOsvn8PFgKGJftG2bqxZnowg0QFq
Output for 7.0.10
iG4gMNFqiNm2npZqIeBPZlvnmIXtBuKu
Output for 7.0.9
dkNp6WNX4t4JNeWJmEIdAD3NxSMRGXEL
Output for 7.0.8
mo6uBrDIJ9f3rg1p8VkOxlpZJMAUXkMC
Output for 7.0.7
lOzifumj6TvujJNYFR3dpwIAOJTkv0Wl
Output for 7.0.6
LUWLCoDts3S8qOBHXqLqT1vweBEpicOH
Output for 7.0.5
KFc3nstHTmCV2xFAoim98xCkDG5bXRsm
Output for 7.0.4
nHMOizFBDHsxeBw9NckxdBoUSv5d5ffW
Output for 7.0.3
ylzYn10opw7NNvv2uMgACENErN39veWE
Output for 7.0.2
mPnUSuROVxohoqYx9ae18E8Xe9f0kicH
Output for 7.0.1
DQ52AFDYm7JDvGmXnsL83bzIauvdT7l1
Output for 7.0.0
S324jdgdkYxVWZuzgdRX0AK9PwCduAOj
Output for 5.6.28
SPfbzf9esgbj9pwpaBAzebsnn9bRkUbd
Output for 5.6.25
oZCjclTsdOEPx344TrMiz67kgxSiXjWz
Output for 5.6.24
6wnNw63QqfcNPcWb0IGl8ARez2iPk3ju
Output for 5.6.23
KziqosxodBI4L8D49WNfviyIy1nwQ9xE
Output for 5.6.22
biQQ6hjABwwh90bdDQQRXAt4qZ5dQ9Up
Output for 5.6.21
dUNfRMqTC5vLClTdSGbaWE7U7xIFfMNh
Output for 5.6.20
fNDZWLaYqkAhi4SA27LXPPRd1aquxFOj
Output for 5.6.19
PKYioeKnnU0GwooecDY5JkTRUgg4ooDt
Output for 5.6.18
OjzeesTafMwzLRjOqnNSvZsShablB1rz
Output for 5.6.17
JjEKKg4FWcL5a25HHOaivgfclFNKpeCe
Output for 5.6.16
OTmnNk6YDw6N2bWrcgnMwzu5DzyFuKNi
Output for 5.6.15
ZCo92SrmTbD0By5ZWYZ8eVc5fSsnKKBs
Output for 5.6.14
j2nJOz3CbLn4usr7fgG9GDMwjxDAeF1s
Output for 5.6.13
6R3KHLncPBPmmnl8jqnRcICXSGcbyXJW
Output for 5.6.12
EbKKHgNLg3g2h7goSad537ROHIrjWVI4
Output for 5.6.11
BaIpi9s8WmktBSKnqyMAii1lVQlr5CmT
Output for 5.6.10
1IkIlbs9epMmhYaGieBATe5StFjMvbwG
Output for 5.6.9
Ca7S7wxCnK5wjoGnfCmsGa4bv68XvmgS
Output for 5.6.8
VCdKEguPJyniN82LrPpPghTetC8mazmh
Output for 5.6.7
HKAigxA504bo1aAfiGe2nTK9BuGQzEzD
Output for 5.6.6
KJvm6MB7qasH8JXvTNO1TTF65VmrRUCc
Output for 5.6.5
px3QPHHjnOTdaIbgwQvcFyJMtCzmqULn
Output for 5.6.4
UR9kZa0IT6AkviLumWTrlEErDonsq5Ji
Output for 5.6.3
uOIc1SaCDTnIiNlpYyTOA9pHAyuRPyN9
Output for 5.6.2
QdJWxu0ZM4TYQebrS8OFG4qPdyaKMilE
Output for 5.6.1
vIs6ARWhKFba7q0YoBmQgn5YpN3rC8Au
Output for 5.6.0
w9Rz7xI04OnO96CZ55A22NKznRna3NrO
Output for 5.5.38
GzA0QnMvfpuJauwwvweSXsw75Z24ogV2
Output for 5.5.37
YUGC0j480FkC2IRS5xQnNROBQJZUNazx
Output for 5.5.36
WdFJajzwdQ81nucxRwgasNwLZfDDySRK
Output for 5.5.35
cEy1pjvrsUkodFYIdZKTFNXZxMXrqwlA
Output for 5.5.34
IudDSuCVRuFgsryyCrywGa0EPtCdwxPS
Output for 5.5.33
4oNgNe61VoIpWLxzTKyztx9XFgTTkkvY
Output for 5.5.32
0JqTvw7bGMQkyjokaw1gLu6tsCxMSMtb
Output for 5.5.31
73jRWGNlzgAxyYz4Pch7PM44RtAk8h6e
Output for 5.5.30
OXsw4Grz52qHGQsWUkTDn68U52yZONZ6
Output for 5.5.29
vDTsNnUOejDsjO1ePzTUc2fwBaTVzGaV
Output for 5.5.28
yfUjZrqbMzh2kVtvKlaY8u9QyJ3UXG9q
Output for 5.5.27
fdn2ozat7LwCDY5jqDs7EVdpiREQ9r64
Output for 5.5.26
jYGoonQheBGNrLHTrfV8lq3dlhV9tiGu
Output for 5.5.25
uK7c7MkAg6w7HhiFTj8Lr8EDp5TguvGD
Output for 5.5.24
MG3nMhlDNOqDa9NcdZGhJ4ADa76rbTLl
Output for 5.5.23
lky04RNc7M4pWbuxecN6PZjKuNzkSlm0
Output for 5.5.22
Og0CYeLIlUVgNCdwlwep4OxKr92kyuGS
Output for 5.5.21
JYyiBcmq9p7nRwkrAGbePLvmzrdqkHAi
Output for 5.5.20
1n9iPnV8tv8aO9rYF3E24yftxeoYXzWm
Output for 5.5.19
yzVcT6Octxby8rgEw6mumES7iW3muupz
Output for 5.5.18
RDbNLOT64g8GSLrJj6LPxgRCoJVIthNZ
Output for 5.5.16
jBkcqpKbLagyU58kaHZomrkLavVegy9P
Output for 5.5.15
J9Gjghe3Hjk9QBniBZ0GaF3ertWqakvj
Output for 5.5.14
iwolT0qoR29fAdXcPX8NLvK41CejHKeM
Output for 5.5.13
BcY6FEw4G4CbAgydPWDRpFc0avxdNw5I
Output for 5.5.12
tZS61NVjYvCVcqQYspRdHt6iLVyOY6CV
Output for 5.5.11
i7hhxpUb7th3JsfcNXQ2CTubfBLi2ZcV
Output for 5.5.10
HbDSBbS4X0FmyySNx9gpmHuaaq3rLA2h
Output for 5.5.9
WNc5aghxVKc2CaosKjosvlnOlwzEX6v9
Output for 5.5.8
ZHCs5DuJOSHIkpIzGienXkxq3WbFBrGF
Output for 5.5.7
ONIeC1mzGVABiqRjcSScziS2HuWL9CRn
Output for 5.5.6
xRWu0RoquMA6K3panXOSHZfFHeFAShYS
Output for 5.5.5
p86d1gNqIahBWLIHGcsQSrRb5JEyctlj
Output for 5.5.4
APGo51w3VvCOEyDK46iJP7yQwACoyRPO
Output for 5.5.3
znWk9v3feND8uzPs04cvyV5ERhzEsJG9
Output for 5.5.2
ymylnKheleYHDR5sEvAMWtCEgnbqwqun
Output for 5.5.1
aCyG8UzuMtfCfdsEhaYiiOa4SHCXKcoQ
Output for 5.5.0
fGzW7vHMq4UAeEf0rzcShp5dzDp0aYyC
Output for 5.4.45
nV5eoymN4DJ8jdLScW5QRRtfCqKvp0lb
Output for 5.4.44
G1tZSryQqfrrJadEDvbQhlStDnBIQP6v
Output for 5.4.43
HaGMWfc71f80rYnrUIntLCaNfKXVMF4I
Output for 5.4.42
7XA1IGjAqUMwz3BxNmhTqLgjwMhllWMH
Output for 5.4.41
E8IApzyytRoZMAFBvAC3k0TAo0fiXqCU
Output for 5.4.40
RENasnhrI2vGCRm9YnB3gJ0Zg4oopbxp
Output for 5.4.39
xvUGZkBEJl78IRd9pKojqwVdZNiKrbBp
Output for 5.4.38
xAeOtdZF5Ufkkje1jTWuJBDRZs9iFK4K
Output for 5.4.37
yzx67mZF8vHX6y9pDUvWVS8IvsKtsjKA
Output for 5.4.36
AcXpnNjRVako1FpKQEulUjn1nh8Cpozv
Output for 5.4.35
6ecgkYTkYet7a0l4iPnOGGWOl4yZVHKB
Output for 5.4.34
Qg45ke0oUlNNaqfuFvAeazZYi3IL15rZ
Output for 5.4.32
ZTazyOBpJlN8Rnfw2S6chw72GGN5SFBr
Output for 5.4.31
UNjYVYtXVCkYYkh3h2RA4Hqp1zLKEEo5
Output for 5.4.30
YMlsy5qIhi4S5tTecSHM6EuRsV4K5aex
Output for 5.4.29
cHfa3aIxvqknhNzyigso9evHOmqR4nop
Output for 5.4.28
WlTRo3aF4bNQivk6pk5SIJjHJa1HPfRw
Output for 5.4.27
5Ym9as5XGF7dGy2YlAubwUiRxueYVD7k
Output for 5.4.26
wpyOleJiYI0fKKD2G25S1pYNxtNbZD6q
Output for 5.4.25
vyVkt0lXGTbJ2igzjOTSpSFoWJ4GcTOn
Output for 5.4.24
rAw2sWrbaOF1MZh3sumtZtt4dFkXoh22
Output for 5.4.23
UCkJTMsyHQp1hFazS3qhx3J5SSzhXB1A
Output for 5.4.22
f4a1yDCsLRMFC15IvglFFTkbSJbXqJhy
Output for 5.4.21
WFaePzcsv0qecm9YhX49N68pGaW40LRQ
Output for 5.4.20
xonwDtLG3zwSV62sXPYGz1X38DlOq1rV
Output for 5.4.19
6oRGViJ3PMHdpj54Zy7plWs7VbFfsSgo
Output for 5.4.18
IMEhxMLGTLldffHwJSLogbUp7YE1UaBA
Output for 5.4.17
TiBrLnTJx4bkB0x4A6qzrvHMnTA0TJks
Output for 5.4.16
3fD0Zr034w1p9ZFyy5WePZWFY7IszOiN
Output for 5.4.15
iduM8bFUIbDP8j2yprtJen5MAwpgnKpP
Output for 5.4.14
lePOX0ud6s5qcVZvnxjZc5U8f1PSBwBW
Output for 5.4.13
q1r6zohZ9PGj7B0Hcr7EmehlsUuu8dGT
Output for 5.4.12
0rqklaZXbQf0QaTAZmlezz1ibFd3CfpK
Output for 5.4.11
E3KdPccYDom6FA5YbO8HV18smg0x6pcR
Output for 5.4.10
1HEquzRLf51ATKabY562GbPREmAmVfHK
Output for 5.4.9
bh0CPDB7hz5a5Zh0hGHK8ioCNq4S2odi
Output for 5.4.8
OY8Eqrgzs8qk7sDNBsMBDcioGd1qVCy9
Output for 5.4.7
7HVgTSgXSPZELqWl4MrCgS3LTjKCmKMa
Output for 5.4.6
vzaB6wMzXPN1g9x5oexyScNnz9x78AX5
Output for 5.4.5
ECtBf3NPyafWhmCgv5b36HniFQDnfeSr
Output for 5.4.4
LiHFsRLR9mqJiVq1R3iyHdyN5aCNw10Z
Output for 5.4.3
GZHm2IVY1v8qyGBuUrEoTC0JY9u37COp
Output for 5.4.2
ozqvOioLiKGTFWypbaljXblpacY4lcE7
Output for 5.4.1
zTzHadRfyGZLXB01JBRJhL6PZSyqfuMS
Output for 5.4.0
lgfwtg8aCdpcuCWFboj89lZO79oJA2hf
Output for 5.3.29
VbdcCL79jFzhEJDuqNxIS4MFNIjLSXd9
Output for 5.3.28
8we5eDMHP55wa99oMnsRx2uPDHCAWfAd
Output for 5.3.27
p9UYmYih8BCxAsGMspZ2QLgXwhpq2Gz0
Output for 5.3.26
0je1qe17lLgvKTI3WVNYxJsk8XjAb5IC
Output for 5.3.25
7kN226dYr2mLSr2Yz3WWrSbZsttkGGa0
Output for 5.3.24
8kt30s5YGXY21BAT820vAK088uYFcZwX
Output for 5.3.23
SXGvrTt8znHg3VB5vYvKJ9JstBUJ14Ev
Output for 5.3.22
d0lpKjFHvbMkjcPFJfMgB5PbNNKPZFuk
Output for 5.3.21
bQuVV5C5aIWWdczNHIConA66ApWMBBXh
Output for 5.3.20
ZjU1ZjW8unwWpUP0XqWslbk5aKVh5RFv
Output for 5.3.19
ZeVAN4FKYFgsUiVI3bgXjpPrMgQp5ueD
Output for 5.3.18
b8B7cmDHQflBvl1sjzKmiZxo1fL0kBN9
Output for 5.3.17
4cdwlx3KqttV9nAmX2UarH51pXcoewPn
Output for 5.3.16
SXYcQm8Jqq8PFMT8uIjMYLBKBU9PzVsv
Output for 5.3.15
QKOOFW4hquTipnrzzZk2jOjK5NHrrXc1
Output for 5.3.14
clREOIAanFKyx0JF9rBubJlyKx0xnZgq
Output for 5.3.13
vGC11DiI7a5QDlUHtDnnV4AgsImCSoHv
Output for 5.3.12
HRzoQE7Di512tvn4ARBXvi9ICMzJsV32
Output for 5.3.11
G7Q5ZIEnG0456UYjYTstpRTGYcV0D5Bn
Output for 5.3.10
TBZs9nV2PaZiW0w4MIg80KxtS5ZVN3BV
Output for 5.3.9
TnTyP1B1MwZNUDleIo0u8SM22onYSOzX
Output for 5.3.8
5odv0QZbjzqhen8GC549gD74a15gtpAk
Output for 5.3.7
6gyvkE9oI1X3oMdmgD7ZlARKXfch6kXY
Output for 5.3.6
aVIJy5q3oyqgEURs6Z1C2Sjq6v6ouO36
Output for 5.3.5
SWEyBPcCDpCyDBoiVr9EoLLwbaXR0uI7
Output for 5.3.4
nX5hz2H6TGuHb0xYzC3A7MsEREb4r3Yz
Output for 5.3.3
Gf1Vpdb2EbFqT9hpxNaAXdTQme8BuvyP
Output for 5.3.2
HRCdaftmluDM4zAq9p4TlbTg9AZjZbfl
Output for 5.3.1
gn4V3UosR7OhNAq64nvkC24ujqBg0U4O
Output for 5.3.0
ZWy6DSatz8hcSn7ow2ESsw4UrtcmmoXr
Output for 5.2.17
Ns8OhJ2HmtfItPjGz4vt32yuWA8RhYQB
Output for 5.2.16
hCuZKw9mxTWm5EpvANzUZQ7iDn5BeiIn
Output for 5.2.15
N9HPU3ljYjobbS3WojnVyvgc2PW7W5qg
Output for 5.2.14
M0gfk6kirLvVqn6Jeq6ssLCjWSwPyPRG
Output for 5.2.13
jbR8ddCmOeBCXRr7NZyRmZUQ2UnEJ1TD
Output for 5.2.12
rRqd7alI2zKEnbNBEG23aoLWVEwsFoKs
Output for 5.2.11
QUMSeRPSKKR44Ft7aKxuTn03kCiJbV9f
Output for 5.2.10
52E4PKrkXYofAAGbT2dhS28kOIaKKypZ
Output for 5.2.9
e6uGYh2KdJeoVmUaC5YReCtgPaBem6DS
Output for 5.2.8
ZqtbnHFOopGYmwsh0zx2a6ZXkZckrlCl
Output for 5.2.7
YpZPFOmNlyg8VrjZ8iFGSA0klwgqt8CK
Output for 5.2.6
u1EowoBlgUZEd8b4eUPX4QqFamReY85Q
Output for 5.2.5
IleFBIie17lvbHyBI7Xm9moUrkDOn4q6
Output for 5.2.4
cz4U45jy113XjuEgL0CnQ3XXOLPd2x04
Output for 5.2.3
zqtnJMaVBeyau1eO9g82D689SgkyEK9n
Output for 5.2.2
XeeMWbRL1nz6FfIVy1zzbKt1vU1qIPZ9
Output for 5.2.1
MT2htZHt7ZqyVYCLwyqdJXwdv8eN1870
Output for 5.2.0
3mgirWF9rmAs6CGVTUqm6rYhZ84W45Cz
Output for 5.1.6
vkdBDF4lCIhvU9iCWRCTdIJl1YBuCOsr
Output for 5.1.5
I0UXR0Gz5Voao8rgHrdminTuSIRCHy5c
Output for 5.1.4
MRreJz4FBMMyH9CXWHhZbbYFts6BxQ0G
Output for 5.1.3
QpPFnpBhCzpqEimMZ6gWunNfhAjujK9U
Output for 5.1.2
jmHUtnJLWwEqBl5wucorA7esNLlfW1vz
Output for 5.1.1
Du3duWfzJ2kSLcjs9ny9LqJfNTXDTZcI
Output for 5.1.0
X26xW2chY3zg5C6ZIQdOYAy5Y6eoHJi1
Output for 5.0.5
lOXa5twOVFkFQebdUpTYTPuKt0cGgSv9
Output for 5.0.4
E0XJl3U9ZvyBN4lcxAsYE3C0FLdBNR78
Output for 5.0.3
leZkaQps6nftRThdJ1gZgMDAEpwU9kix
Output for 5.0.2
on8R6TAghOMrPIJ4XvhreR4dLTc4AqNb
Output for 5.0.1
u3NZvS84DMtqXeX9FhPeL0RFly1YBX45
Output for 5.0.0
QnWxypxlmUyJPCPhXrRuew89FXXPNgS2
Output for 4.4.9
YiQXxxh6LV0PbwhwDbfha7fRaJ8AvPk7
Output for 4.4.8
cqv9WgIi1bRH99n9TPmjd2xdmAU1eeRo
Output for 4.4.7
FJ1c4Ax1llqEJx8Da61cA0Qr8Zr72Bju
Output for 4.4.6
GcGx2xnIvwzS1u7dXNAAsN0T0XLo8L93
Output for 4.4.5
ANzos3e9iHReNFK8FLgR63VZs2DbAPu2
Output for 4.4.4
8tNLk5TQFru93jiPuh3LYyHp75slZagA
Output for 4.4.3
UusWyxSF0GBpRebOCEPcxkZuUZ8eDpUT
Output for 4.4.2
9r7tz7MErhKUfCuSOzXmkgjsAeMgXWto
Output for 4.4.1
yg1koeH1vUZYJBd7vWYED04eGf32SrZn
Output for 4.4.0
M7kBdsg2NKwhiVzJRZV1PIkSzKY2kDlf
Output for 4.3.11
isiPsfstMq3zkc1b9C7EYz2v7wtFtUx5
Output for 4.3.10
70gx1rc21xWYKdbGAFHvZ816WexdJnFm
Output for 4.3.9
RxR5XEjj0hoYRsMsJp7cc8IrHSxUo0QP
Output for 4.3.8
6E9H04lvI3IiZX4upQRxYuW7RlTGKygo
Output for 4.3.7
hMkpdFz0d7ZzMjXJwmKXh43MDyl6k2EM
Output for 4.3.6
sznOIkj1sGfdOwuW8jJ8tHiJlUk35BxR
Output for 4.3.5
DviCGrFi1wt7KF80xGCLUl8x6bVsPY0v
Output for 4.3.4
lcAhEHME3sGLtE9C5vAKh8K9Lm6QpneU
Output for 4.3.3
XvYNASdk0Z8sUXhPtvcS6t1gqVzjxvQS
Output for 4.3.2
63BQ2E6idTLxWZTXCUxQvFOlo6daZpPo
Output for 4.3.1
lRgwayU33GCZleLb25nGKDJlzvFamihj
Output for 4.3.0
Ft08xLv8CTx3fzB5q9MCXTH1o28UAR3f