6 digit alphanumeric random code generator php
function generateRandomString($length = 25) {
$characters = '0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ';
$charactersLength = strlen($characters);
$randomString = '';
for ($i = 0; $i < $length; $i++) {
$randomString .= $characters[rand(0, $charactersLength - 1)];
}
return $randomString;
}
//usage
$myRandomString = generateRandomString(5);<?php
// online code for creating alphanumeric in php
// this will generate 6 charactor, you can create as many just change the 6 from code
$pass = substr(str_shuffle("0123456789abcdefghijklmnopqrstvwxyz"), 0, 6);
echo $pass;
//output : 17w2y8
?>
Also in PHP:
- Warning: func_get_arg() expects exactly 1 parameter, 0 given in
- Allowed memory size of bytes exhausted (tried to allocate 4096 bytes) in phar:///usr/local/bin/composer/src/Composer/DependencyResolver/Solver.php
- convert time to string in php
- create project laravel 7 ?
- Allowed memory size of 33554432 bytes exhausted (tried to allocate 5287496 bytes) on laravel
- api newslater with php
- The key "initial" is not recognized and ignored.
- Undefined variable: subcopy laravel mail
- array_search
- check array is associative laravel
- create random username and password php
- clear cache terminal laravel
- create a laravel 7 project
- Your Composer dependencies require the following PHP extensions to be installed: dom, mbstring, xml, xmlwriter
- activity log spatie
- exception php
- fetch value from json link in php
- cache laravel docs
- date php :w3schools.com
- check if includes numbers php
- display error reporting php
- check session in blade laravel
- ext dom php
- How to execute “php artisan migrate” and other Laravel commands in remote server?