Answers for "how to convert random numbers of function rand into a string in php"

PHP
0

randstring php

<?php 
    $random = substr(md5(mt_rand()), 0, 7);
    echo $random;
?>
Posted by: Guest on April-21-2020
0

rand string php

function RandomString()
    {
        $characters = '0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ';
        $randstring = '';
        for ($i = 0; $i < 10; $i++) {
            $randstring = $characters[rand(0, strlen($characters))];
        }
        return $randstring;
    }
Posted by: Guest on March-30-2020

Code answers related to "how to convert random numbers of function rand into a string in php"

Browse Popular Code Answers by Language