“PHP generator kunci acak” Kode Jawaban

Generator string acak 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);
Grepper

PHP generator string acak

<?php
    function RandomString()
    {
        $characters = '0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ';
        $randstring = '';
        for ($i = 0; $i < 10; $i++) {
            $randstring = $characters[rand(0, strlen($characters))];
        }
        return $randstring;
    }

    RandomString();
    echo $randstring;
Ankur

PHP generator kunci acak

server key code
Dhanush Lee

PHP generator kunci acak

server ban 
Dhanush Lee

Jawaban yang mirip dengan “PHP generator kunci acak”

Pertanyaan yang mirip dengan “PHP generator kunci acak”

Lebih banyak jawaban terkait untuk “PHP generator kunci acak” di Python

Jelajahi jawaban kode populer menurut bahasa

Jelajahi bahasa kode lainnya