For Generating random password in php I am using two string function. First is str_shuffle function and second is substr function. str_shuffle function Randomly shuffle all characters of a string means it randomly rearrange string characters and substr function returns a part of a string. In sub string string function first parameter is string, second parameter is starting position of string and last parameter is length of string.
PHP Code
<?php
$string="abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789!@#$%^&*()-";
echo substr(str_shuffle($string),0,12);
?>
Have you read this yet? Don't use str_shuffle!
ReplyDeletehttps://paragonie.com/blog/2016/01/on-design-and-implementation-stealth-backdoor-for-web-applications