vendredi 21 décembre 2018

Why is PHP selecting the Random Values like that?

So... im was testing something and noticed if im Use my code like this:

$arr = str_split("ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz1234567890", 1);
print_r(implode(array_rand(array_flip($arr), 16)));

The Output is

Refresh 1: BDFIJKPTVkl12789
Refresh 2: HIJKMQWYdfmorsw3
Refresh 3: FGHMNRVYfhknouw5
Refresh 4: AFIJKRSVeiuwx579
Refresh 5: DJORYZcgijlpqry1
Refresh 6: EISWbhjmoqr45689
Refresh 7: CDEFOTXdhkloqr27
Refresh 8: AEFIKLNORSknx349
Refresh 9: DEFHJMTVZcgpstz0
Refresh 10: CLQTZbefhnpq1279

Why does the output start everytime with 1 to 5 uppercase letters ? that "randomness" is pretty weird in my eyes.

Im realy interested in the Background why that is how it is



Btw my first time using stack Overflow so sorry if this is post is not perfect :D

BTW Im German so sry for anything that is not perfect English ^^




Aucun commentaire:

Enregistrer un commentaire