Answers for "random unique string generator php"

PHP
28

php generate random alphanumeric string

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);
Posted by: Guest on October-30-2019
0

php unique random number

$uniqueCode = md5(uniqid(rand(), true)); echo $uniqueCode;
Posted by: Guest on March-24-2021
0

generate unique random number php

<?php
$n=range(11,20);
shuffle($n);
for ($x=0; $x< 10; $x++)
{
echo $n[$x].' ';
}
echo "\n"
?>
Posted by: Guest on November-28-2020

Code answers related to "random unique string generator php"

Browse Popular Code Answers by Language