3v4l.org

run code in 200+ 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,1,1);
Output for 7.2.0
ZUNMFDGYJADOYKARKZGEBPPLNJLTSTDZ
Output for 7.1.7
JZIRCMINQNNWLLDFYKCLJMXWZDYSPUTM
Output for 7.1.6
TJEMISLGFTGPDRZYQPNBSHFFCPIOSMVM
Output for 7.1.5
MHMMHHFAFBUBJBJFHGREWFFDHQEEJGGO
Output for 7.1.0
SQDLQNUMXRTNTIQVIWABGLKSQAPOHFXE
Output for 7.0.20
IDAMYSAJEXAFNXOUODTQZVBTWPYMGBBA
Output for 7.0.14
PRGMWLVVIDUTGBNEICJNVAMPCMIDEPKR
Output for 7.0.10
ZSJOIXVRXEAFMMNUEVZLXCIVERSKVPRC
Output for 7.0.9
HZGZONNKGKMWGGFDHAYUZVZMFAFIVLSL
Output for 7.0.8
CVGJJAUKOZLAPLOCICNADXOWSBYGOEXN
Output for 7.0.7
AVQARQSPXEBKOVDOCPOCZSYSCWKPJKLY
Output for 7.0.6
SFHQVQIOKITGRYCEQYOCXCWVGBRTYBGO
Output for 7.0.5
JMBZJCUBNWRIQMUCILKSJPFGGBTKWDCO
Output for 7.0.4
NECAEFKOMVHFILIGFARDAULLYBEBQHSA
Output for 7.0.3
ZPEHHNNGPPOGECZIXUUYSNMUDDTLYIPR
Output for 7.0.2
LMLDENAWRGZJNSSZPUALSDMRVFTBPZSW
Output for 7.0.1
IKWMPRKHXKPCTSTTDBGFMHTLVJWCJXRV
Output for 7.0.0
ZMVWWWNAXVUZFHWQJXDQNWIJYEOVLPCB
Output for 5.6.28
WPRJFIIHNALGLCVKDALCBQUTJSRISELP
Output for 5.6.25
SUZRTGQRBGBUPOSAUTICCVXMDGCAUQUV
Output for 5.6.24
IKMWKLLZEJITEAHZQLTJXIPKLSBBKSJL
Output for 5.6.23
UYQVIHKRGTRZNVBNCJPDLRPEUNDXJVZE
Output for 5.6.22
DYTLSBPGAGQJFPRWTGEHTWSWWWSTHLUN
Output for 5.6.21
GWDBNOBAAVXBEBHHCWJVLIYGIITDPPXW
Output for 5.6.20
QRCGQDGRWOSODKFDQTRBMCLOOANQKZDC
Output for 5.6.19
IMFGMKIHINONEJNAVNSPDWZBEVRZGTMS
Output for 5.6.18
FNSYZIBFPBDESYZLDDGXNPKPDOHNWGTS
Output for 5.6.17
TSJEPOVDRGEYKBBBSSIFNMQKWJFKJFEP
Output for 5.6.16
OUQXQLWMFVGZPFARBTADAYSYIGHNZOWI
Output for 5.6.15
LDKTPHWUWAUFDUBNKNWZRJUOHYRXBERO
Output for 5.6.14
FJOCXNUORZJJWXSBGOJZRQIBAHZBKOSG
Output for 5.6.13
PYLNJBMTUIVDERUOARKOBDJAWFSCPFDL
Output for 5.6.12
AKLLOCNKPVNNRVCVCIWKPUJSHPNGVIAU
Output for 5.6.11
VFHGJNNKYIZWYMQBDNQVVMBKJOKLWOEK
Output for 5.6.10
YVWBXEKPBEOMIKXBZZYZLTXVYRCUBTVC
Output for 5.6.9
UQZUEXMOFFLZLBRXJUZWEEBXPZPLVBYR
Output for 5.6.8
YRFULPQFYJONPUJZRVEQATZOLUVESRMZ
Output for 5.6.7
ITPIOFDWOCXLWUXTLRQKIQERHHJWASEE
Output for 5.6.6
FTQXJRBRNRCFYGBQLPKSEZLGLWTWOHVS
Output for 5.6.5
KOKFVKCYXAJHYZSJEGLHLBNEFXZNVDKH
Output for 5.6.4
UVRRICARMTVLTWUJJMIBMEKXUUEKGKIR
Output for 5.6.3
ASWHJOWYZNZCTVIDQMDEYYENBBSCFUCK
Output for 5.6.2
GZEQLXWAWFFPEKKBYAYVWVQPBACKHAAF
Output for 5.6.1
IDGUXDQPEEXRIRTKMGFGQUPPVTPGNEIB
Output for 5.6.0
VAKDCCZXWWYWPONNTRCWKHHHBJMRQMFV
Output for 5.5.38
KMUNZISUBRYJBCPAIWZEOCVLWQUWHETM
Output for 5.5.37
QEXTSWRKHIIXDFOBZJSECLUQKPGVIAKB
Output for 5.5.36
ZBVAYDZGTGOVQSDYQNESJIASOEZLYNIF
Output for 5.5.35
VMLKIDJWQADNCREZIKSWWGIFJLSVDTRB
Output for 5.5.34
CXZPIGKMROZQQNXGHPQPWUOYKDPDQKXC
Output for 5.5.33
OICDWTUWFFFRYTKUWZIDSKQHWZUBPGHK
Output for 5.5.32
UXLSBFCTNFGFMQPEGHISPPWDBEVCKTJK
Output for 5.5.31
UARMPLPFUZKXHFIJBHIVEJITESAFUSMA
Output for 5.5.30
PXJNRLXFTSMNEOXVIJOQNFDRIGIBRSER
Output for 5.5.29
HHCHQQLLQYDMERLNJTUWTVTMHFJCSSBO
Output for 5.5.28
VWUDAPQYFYJKABHRCFZHBFNYPDUXDPWO
Output for 5.5.27
RZAATKKBSMTHRDOEEKDORXWYCHRJABYG
Output for 5.5.26
BWKYMHAHVKVYOAAYHQSVAEVDSMACCOPB
Output for 5.5.25
VUSEVUAIOLSCFEVYLFDPCCYMEQKSUJXR
Output for 5.5.24
ZKZHZOYZHOFDYYSKISXYMJQOSGRXAPIG
Output for 5.5.23
PBBEOHMQRAULXNQRXVHCYJCTPIZBSJAZ
Output for 5.5.22
GYQPHHUYQXZMQIREYGWQJPTJOTQPGYRI
Output for 5.5.21
JHPFHFWZROSRCFHLEKFPZHZKVDAXCWXW
Output for 5.5.20
BGLBZPGHDOIAWQLKJDCSYSIQHFTARQOT
Output for 5.5.19
UKKHLSFGRULRGAJBRSKDIXXQKFVUCLTK
Output for 5.5.18
ZQBKWIXXBCETVBDTZIKYJMKNHOQSOWLL
Output for 5.5.16
QDDQQHTNSCDEFJUIGQUZWGHOSLNDZPYN
Output for 5.5.15
ROGPZADPVQASHOWQBIMZBZLCUEGKPOCG
Output for 5.5.14
DIUMDHYLOZLRSRCVGMMDHIBGBSORKGQC
Output for 5.5.13
VUAHPSMOUOCLTANDNWBKAKEDXILNYFBT
Output for 5.5.12
CYMEIQIHFMCZBGSCLVXCRMFTBBDYLKLX
Output for 5.5.11
MZKNCKSVKFYTZAFAXSRKZCOFDMTIOKXK
Output for 5.5.10
FUNHVNFHWXOSDBPFVQTNFEXPKQIQFVDZ
Output for 5.5.9
OKTQZXCSNGCBUWVROWJGLFFZIIZLQLOC
Output for 5.5.8
DQGEVXGHIKLCOENVNKLRGMHYHVSMSYBD
Output for 5.5.7
WAFRNRZRXFVKNMDPXPWDVVLDSVQFMXYU
Output for 5.5.6
AQMSSSXVFWBKLRHLURTTTJRPTPYSIFZH
Output for 5.5.5
AUXAQSHSVWCEGYKRTODIWWTHWAFMVQHP
Output for 5.5.4
BPARVGCPVSCXSJYACIDRRCFQFPWEHFCR
Output for 5.5.3
XXZSBAOHSEGZWJDTNNSGMVBPDAVOFWYO
Output for 5.5.2
JATRAZVIDDQNUEKHSTTZNZEANNOLYXRQ
Output for 5.5.1
RCEQGLIMGJFCIMBYYMATATOJDAPQSUNB
Output for 5.5.0
CSCGOYQAULEALDNDXHAMAVBHKRYDEOSO
Output for 5.4.45
EXEROPQYVNOKHVBTCDYYEQWVVDBWWDAP
Output for 5.4.44
LMZTZVNLETKERUCVEKCYBISXYJPHHBTO
Output for 5.4.43
WCVSOLRJCCQLAMIIBPBGGRICJUXYWPTD
Output for 5.4.42
ERGAFENJINZXPABYFBABODKVCHTBEFIL
Output for 5.4.41
YVLNPCFJXZUICVNXNSBLHTEECZZNYFLQ
Output for 5.4.40
VCYHQCNZCNMLAPYUISARBBGNFNZRJZVM
Output for 5.4.39
QIATYOGLBHLYKYFVNPDJHBXNOZHYLGIK
Output for 5.4.38
IWRBLRHNSAYRUOXKQULWPGHNDOYSBGWC
Output for 5.4.37
WKKCEHSYWVLBJFTQWARNIQNSCUDORYYQ
Output for 5.4.36
OXWHRYKRZWIYFWSCRHFQJQPQJVGMZYEZ
Output for 5.4.35
DZHQYHBTWBYUISTULWIKZEXWAJXSKWCV
Output for 5.4.34
ZIEFLCIJYMKVNXGDKFWKJUQYVQJTDFPW
Output for 5.4.32
VUMJMPHQKXPFPQSISKMCFFBWMGKKKHCZ
Output for 5.4.31
ZSBJZQEZWEBUPWGASOFYKKTBUHCXJMXQ
Output for 5.4.30
UZYTXDQRBPQBBLNUKJTPYDMGTXVJYWZQ
Output for 5.4.29
JBBKRQQBVPTTIYSJNNZIGRLLEWFUDIHR
Output for 5.4.28
AHEVMIVEQHZVCZSXOMZVGWQSUTTZSBQT
Output for 5.4.27
NNTOLTKBYFTRHPXCXLVJTWJDNBOHDXDP
Output for 5.4.26
LYVDELPRQCVZUWWTVQEYDAXDFXKTPDSY
Output for 5.4.25
DWHWJBMJVQRCADEIXUBGAQNGSIVLWURL
Output for 5.4.24
NUUPVWWRAVQOSUQAACIKCUOLHKLJIMBD
Output for 5.4.23
SNZAMNDKNTFRTSMFXLEEBXNJEFECSVLL
Output for 5.4.22
DKFYHLWSHSSENHANXFKFSHIQXRZLBKMR
Output for 5.4.21
QMLUVTVMMXRXWKSYOUORTPRGPPQERCHJ
Output for 5.4.20
PRKPQIMXJKIBGWOBSMHDTVQVXZWGRNKX
Output for 5.4.19
RKMWERVFWEGWXKLOTAOLNXMTAIGRUKHO
Output for 5.4.18
RBZIBLMVUZQEUFBUWXQAWJPRKHABEJSC
Output for 5.4.17
PPPKRBROSHVOTVOVCIISTGNTESTXJMZK
Output for 5.4.16
JWLJYFDZPZIIJMLSYDJLUMOQQGJRSKDW
Output for 5.4.15
GMNVFQXMCNJIKKOXITZUKKBOBBQUSUFO
Output for 5.4.14
HLDVTYYAPXMVJNXSCIVPTVEZFWMZPGSS
Output for 5.4.13
MVKIJZDXADAHEKCXXUVXCBASJOSEJKYV
Output for 5.4.12
IACTYRSLQYOASEFSDLLURUAYGSBVHIFX
Output for 5.4.11
SSVFSHMYEFWZFZTVUYPLWXCPYIOASUFY
Output for 5.4.10
GDEBIBRUVKBWUMQPFGFIZRBOEFLALKOE
Output for 5.4.9
MONEQTAVXDMOLECJZQUCSYLBVHWYXBBB
Output for 5.4.8
FVLGXLJHXJXYWSQRHSVAQJVKVOPIAIWV
Output for 5.4.7
FSRRXTTUVPAGENFRRYFKMAEUWVIYGXFR
Output for 5.4.6
ZMNMCGXMVZCEMKUYULAQQVTUEXXPZZWU
Output for 5.4.5
QJMTFEQDVYUTTRRSKMVHQBWKDUXBVEYN
Output for 5.4.4
ZHRCUPOGSEXBFJGYHSDDHSXIEEDDZQQB
Output for 5.4.3
DRKBRFATPEOPVJWYZRDHHTNWOKRMWTBH
Output for 5.4.2
GTTDHYLLVPJJONRJUZDHTBFRLRGGRSFT
Output for 5.4.1
QJVENCEWEVUEKPOWVPXWECSQYEYTLRZX
Output for 5.4.0
KWXSBASWFANNSQWQQCSTONQLHXAZGRFT
Output for 5.3.29
JIRKPYQZMNHMMIUPBLQCLBZOMPAOKTJO
Output for 5.3.28
BAKWLZGFINCUADBZMKWQTCJDZLBJJBGZ
Output for 5.3.27
KWQEPENODAXJIWSDSABMWUNDPPEGUYFJ
Output for 5.3.26
YTBZTXHKSRJVIFHKUAPPBBWCVYBXDWLS
Output for 5.3.25
BFARWVNMUVOIWPOTEDOXAQANHOOBSECD
Output for 5.3.24
ZRPLFSRAGZYYBWZABFYIWOZZIAODNMCA
Output for 5.3.23
NLPRRZXDHNFUHVGZICNYSVFNFFACXHKY
Output for 5.3.22
PJNEZIUJYZCYBGXEFLQQIGZZYWEMIIBB
Output for 5.3.21
MOCKTIVWLOMNDNOAZLBIFVGXSYINBGCS
Output for 5.3.20
LEOQKPTSMGQXAXUUXVAXFISWOUHHTARM
Output for 5.3.19
NLIURBFJWHOXLLBFQQQFYUWCCPGYSRKI
Output for 5.3.18
NXPYHTKKJNGIYIBUAFDTJZYFWJADOVCQ
Output for 5.3.17
BMRRPNMPGKXSHBAIOJKZYIRMNJUBFNYE
Output for 5.3.16
ESBQLVZTMELFYCSIAYOLGAZEPKNEYJCI
Output for 5.3.15
PLMRYLVSEOBNGDQMPAWBPXIJNIGIUBLV
Output for 5.3.14
KJVSFQRRIFBXCITQFMYNXXXWOJAGSCBS
Output for 5.3.13
LCQHSUIELFCZUWGWYLCPWEGYGJJXSREI
Output for 5.3.12
RUKRDYKWRCOWMDEVCRKXKQUKDUDZIXOQ
Output for 5.3.11
XRWBQYYNNIQPIGLKFRTJYJURHJMEKKMJ
Output for 5.3.10
RQVUHVIXUVSCWEMRNGZWWVARVIDFBWPL
Output for 5.3.9
CKYATWWGXDQKRSQQZJYDULZTYVFLFJMX
Output for 5.3.8
AGWVLLZJDFPMNOIFZFQUVNJJCYTYPBCL
Output for 5.3.7
CKNLZMFYLHBOSDYIFOKEYTXWOPSRYFUT
Output for 5.3.6
CGHNWYCUSXPOCTVEMHTBJGGZZDRQPBQQ
Output for 5.3.5
LMROHWMYCFIIGNROMAGILSKSCYNTNMPR
Output for 5.3.4
NBBTQHDBUGZGGWFCKFQGGZSWNIVCMXYE
Output for 5.3.3
MUGCHPUXOKVJGAMNSRUUDNLFHLKOQQFQ
Output for 5.3.2
SZDSARRVUTUAGVNEQGDRRFQYXSNNBPBN
Output for 5.3.1
QHIDJPLFUESWLFQRNHYQQOYILCIEOQMV
Output for 5.3.0
WYDKGEYDFXCJOQUUSWCJFOQINICAUEXJ
Output for 5.2.17
LGYYBQWWFKTFXQZLQREOZVMJTBOBOIHR
Output for 5.2.16
QHYWYSBLOLEBPPIDAOPMGPATAHCMFFGI
Output for 5.2.15
IQUUKJUWQVTANKWBEHCGDEYAQYZGUDFS
Output for 5.2.14
MAEFFSPWGYOXXZETFHRKXGCTKNRBSMBX
Output for 5.2.13
LWMTKPDNNBQJIFPKMLOVNJXKNWCABCGK
Output for 5.2.12
HHCWHESPBEGHAXPGLTLFCAAKOIXTWQTK
Output for 5.2.11
JMIYCMSRETKZUGDSQCIGBGHAMGLFOGEN
Output for 5.2.10
EINKPRREWXPHSFOUREEJGCZZHBQOXJLK
Output for 5.2.9
GRBKTGEJJXITMIKNSNJSGNUVQNRVQAUI
Output for 5.2.8
IINCVJMNQKSVXDSSRWCASYKAAHKOHWDU
Output for 5.2.7
BQMVILBBXOADXTAQHMUQTZGXLVHRTZQW
Output for 5.2.6
WFWSDGVWLWYKOYJSXKXSCPKURUIVMKHQ
Output for 5.2.5
NKTTUOLOGJHMFBNWHFMZZCBNGUFZPENW
Output for 5.2.4
OUHFOHEZKHCZSZQJZGCMKRXHHUDXICME
Output for 5.2.3
YXODXUHUASRPMDHUCCCXJMXSTCGLFNDG
Output for 5.2.2
CRQQBIPOAPHYPGODPCAFPYUZNROCSERF
Output for 5.2.1
UNTHWCRZKJTJXNPIUKYEAHGLDGENLSOF
Output for 5.2.0
OLDUQWJALTYQEXKLLUDCHXWMXNKALYEU
Output for 5.1.6
XNBKNKPIFAVGBLJWRBYTDHFSHDHVSDVI
Output for 5.1.5
KRWUZIJZNWBFRIVZEPCRBKZPVTQWQKRN
Output for 5.1.4
CDQBURIZIRFAWCNTLPHKTCZKJGXJQUSD
Output for 5.1.3
HLRUKJTASBQMWZHHUUMFOUZQUSWXXGND
Output for 5.1.2
YOHGDHEMYTCVPXQSQFFTRVVCKFXDXEKP
Output for 5.1.1
WPVAWMDUSNWSRYYWSQLZGWNPNIYEKWBN
Output for 5.1.0
CUEMTFXMDMVIOOBOSNUWBOQWQOVEYWIS
Output for 5.0.5
CSQNQZFENRWIDGAZAIURJNAKLVIOVDRR
Output for 5.0.4
ITDKOJYXODGFGIQIMJVSQVUBNQKUTCKU
Output for 5.0.3
WLMKGFVBCKXHLKHTGABZYFBMJKCQBZPM
Output for 5.0.2
UXXFBCNEXEBWLPNADIXXQGPRTZONDNDJ
Output for 5.0.1
NHDGJJWHDMPJXSFBASBFRNRJWMLINXXV
Output for 5.0.0
UZLVJVJNOWAUTAYYEROPTONMIJALJVWK
Output for 4.4.9
JQFLFCHMKGINFTWKILXOBDJQJDMNVHLN
Output for 4.4.8
KHHTULMAKBHINSQIRHWZMTTNMTLAAJQD
Output for 4.4.7
MLBLFAPXTGJIFIYVQMITWABNIYNVOOYN
Output for 4.4.6
UVWORCCMCPWSGKZALIXCNARLOMTAIPGD
Output for 4.4.5
XUVZAZRUZYTWMEHVSYRNJPRTHNVTUNWX
Output for 4.4.4
ZNCQHXJHUGJVMMAPUCIIIPNOZUEBFAMX
Output for 4.4.3
ACUIDBIWRVUGKDOLDNHJWBZZIURSMGXA
Output for 4.4.2
CLTVUAYEZTHOWQGEORIZOITWHUWIOSWJ
Output for 4.4.1
YXVFNLLUVNFDYORIRECATDKDNRXNVAYK
Output for 4.4.0
XSPKRZHHIFCUSYTLQUGYPAMXRTABFZPN
Output for 4.3.11
ZJJZOFCVNLUFNAWBGBTUEOMFKXJNWBJE
Output for 4.3.10
VEXMLNKUWKUMYOVXMAEOVSRWIKRYEXIJ
Output for 4.3.9
WSYMZCJMQLUPUJFUYWTPEDERUTFYPINC
Output for 4.3.8
YRHIJUMOKJJOMIHFRGFYVMYGPZCIKPRI
Output for 4.3.7
RUGZYHKXUNGXYXSQUNXJEKQBHZIFSLGO
Output for 4.3.6
JDVIEXCGZOKCXMELZHCBOXJAPDVWSWIA
Output for 4.3.5
GVLIIPEQEYDKQMEHZQUAKVWOOKGSOVJZ
Output for 4.3.4
PTKDHPTKMQUNTFVNTGLHMQKAJBOLHPDY
Output for 4.3.3
HKGLIUFKUSGHQQQKPQHCRPCTWSKIAETI
Output for 4.3.2
OGMRBSVNNCXSKDRTEGPLMIJBBENXSQDC
Output for 4.3.1
LBNIZMUDTQPLRUDUHBTYAHPDMRZLKAEU
Output for 4.3.0
WDWCBIWYORKWPMCAZUPCDWDKQUIJLPPL