Search
 
SCRIPT & CODE EXAMPLE
 

PHP

php code to generate strong password

<?php  
  function randomPassword() {
    $alphabet = 'abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ1234567890';
    $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();
Comment

PREVIOUS NEXT
Code Example
Php :: laravel auth 6 
Php :: send OTP php 
Php :: emergency password reset script wordpress 
Php :: php laravel config 
Php :: laravel validation greater than or equal to 
Php :: if condition view page of laravel 
Php :: add text to image and save php 
Php :: laravel select selected 
Php :: custom laravel auth 
Php :: laravel mutators 
Php :: add custom page to wordpress 
Php :: phpoffice spreadsheet background color 
Php :: running laravel queues in shared hosting 
Php :: Laravel adding Foreign Key Constraints 
Php :: destory session in laravel 
Php :: laravel collection remove empty 
Php :: laravel find by field 
Php :: php cookie 
Php :: codeigniter 4 query builder get inserted id 
Php :: make project in laravel 7 
Php :: laravel query builder get last insert id 
Php :: softdeletes laravel 
Php :: wordpress get id from page title 
Php :: codeigniter form validation datetime 
Php :: symfony set timezone 
Php :: array pop php 
Php :: laravel continue 
Php :: laravel controller update 
Php :: php 8 match 
Php :: for else laravel 
ADD CONTENT
Topic
Content
Source link
Name
8+1 =