Generating Random Strings in PHP


Generate a random string by shuffling a predefined string or using random_bytes() for more randomness.

Source Code

$randomString = substr(str_shuffle("0123456789abcdefghijklmnopqrstuvwxyz"), 0, 6);
echo $randomString;
Subscribe
Notify of
guest
0 Comments
Inline Feedbacks
View all comments