Write a PHP script to generate simple random passwords [do not use rand() function] from a given string. Sample string : '1234567890ABCDEFGHIJKLMNOPQRSTUVWXYZabcefghijklmnopqrstuvwxyz' Note : Password length may be 6, 7, 8 etc.
function rand_string( $length ) {
$chars = "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789";
return substr(str_shuffle($chars),0,$length);
}
echo rand_string(8);
Also in PHP:
- create model for existing table in laravel
- $ php artisan clear cache
- afiseaza id-ul sesiunii php
- exit try php
- Your Composer dependencies require a PHP version ">= 7.2.0".
- console.log() but with php
- clean laravel
- delete cache in laravel command
- /DependencyResolver/Solver.php on line 223
- date format r php
- array_key_exists php to python
- date time php format double digits
- convert am pm time to 24 hour in php
- Adding string with number in php
- check number is positive or negative in php
- error init php eroirrs
- date format create in php
- Allowed memory size of 1610612736 bytes exhausted (tried to allocate 4096 bytes) in phar://C:/ProgramData/ComposerSetup/bin/composer.phar/src/Composer/DependencyResolver/Solver.php on line 223
- Detect a users location by their IP Address manual php
- display_errors php.ini
- check string in wordjs
- check if php array has key
- array_unique check array key level
- clearcache artisan