Search
 
SCRIPT & CODE EXAMPLE
 

PHP

Generate Unique Random String With Any Character Size | unique random php generator | php unique id generator

function generateRandomShortName($length = 11): string
{
    $string = '';

    while (($len = strlen($string)) < $length) {
        $size = $length - $len;

        $bytes = random_bytes($size);

        $string .= substr(str_replace(['/', '+', '='], '', base64_encode($bytes)), 0, $size);
    }

    return $string;
}
Comment

PREVIOUS NEXT
Code Example
Php :: like %% inside the array php 
Php :: laravel model with migration 
Php :: remove special characters in php 
Php :: laravel read csv file 
Php :: laravel check if email is verified 
Php :: Entity of type "DoctrineCommonCollectionsArrayCollection" passed to the choice field must be managed. Maybe you forget to persist it in the entity manager? 
Php :: php include 
Php :: php current time 
Php :: php artisan route list does not show all my routes 
Php :: laravel mail send to multiple recipients 
Php :: laravel @disabled in laravel-9 
Php :: php regular expression function 
Php :: format a date sting php 
Php :: get last element of array php 
Php :: while true php 
Php :: group where conditions in laravel 
Php :: check if post exists by id wordpress 
Php :: has password argon2i 
Php :: php slice last arrat 
Php :: using php to add numbers in html form 
Php :: random integer in php 
Php :: sass mix laravel 
Php :: laravel delete multiple rows 
Php :: php check image size before upload 
Php :: php add get to link 
Php :: laravel number input positive only 
Php :: session() in lumen 
Php :: laravel phpdoc collection of model 
Php :: rodar migration especifica laravel 
Php :: html pagination php 
ADD CONTENT
Topic
Content
Source link
Name
2+3 =