A string can be shuffled by using str_shuffle function, here is an example.
$string="abcdefghijk";
echo str_shuffle($string);
The output is here , you can change this by refreshing this page
cfadhbigkej
Password geenrator script
We can use this to develop a password generator script where we will create random passwords by using different types of chars. We used substr string function to get short string by taking out first 8 chars of the string only. Here is the code
we will get 8 char random string to use as password
sjrvk)l^
In above case we have used three stings and added them before shuffling to generate password string. You can add more strings like all uppercase alphabets etc to generate desired password. We can take user inputs also to use the combination of strings to generate random password.
← Subscribe to our YouTube Channel here
This article is written by plus2net.com team.
https://www.plus2net.com