“como criar alfanumérico aleatório em php” Respostas de código

como criar alfanumérico aleatório em php

<?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
?>
Mr. Samy

PHP gera cordas alfanuméricas aleatórias

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);
Grepper

Respostas semelhantes a “como criar alfanumérico aleatório em php”

Perguntas semelhantes a “como criar alfanumérico aleatório em php”

Mais respostas relacionadas para “como criar alfanumérico aleatório em php” em PHP

Procure respostas de código populares por idioma

Procurar outros idiomas de código