PHP Password Generator
function rand_string( $length ) {
$chars = "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789";
return substr(str_shuffle($chars),0,$length);
}
echo rand_string(8);<?php
function randomPassword() {
$alphabet = "abcdefghijklmnopqrstuwxyzABCDEFGHIJKLMNOPQRSTUWXYZ0123456789";
$pass = array(); //remember to declare $pass as an array
$alphaLength = strlen($alphabet) - 1; //put the length -1 in cache
for ($i = 0; $i < 8; $i++) {
$n = rand(0, $alphaLength);
$pass[] = $alphabet[$n];
}
return implode($pass); //turn the array into a string
}
echo randomPassword();
?>
Also in PHP:
- curend date phph
- check if contains substring php
- capital letter php
- Warning: mysqli_fetch_array() expects parameter 1 to be mysqli_result, string given in
- IF SEPCIFICY WORK CONTAINS
- catch error php
- create random password php
- date time format 12 hour am pm php
- check array key exists php javascript
- LARAVEL migrate error
- apt install php7.4-mbstring php7.4-zip php7.4-xml
- Allowed memory size of 1610612736 bytes exhausted (tried to allocate 4096 bytes) in phar
- cache clear laravel command
- check if string is not in other string php
- add date + 1 PHP
- artisan show routes
- date("h:i:s")
- contains the symbol php
- Cart::total return number format value laravel
- check if number doesn't divide exactly by 3 php
- Web servers supported by php
- config cache clear in laravel
- date format in am pm in php
- elevated th in dates format php