Search
 
SCRIPT & CODE EXAMPLE
 

PHP

how to create random alphanumeric in 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
?>
Comment

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

PREVIOUS NEXT
Code Example
Php :: install php mysql extension ubuntu 
Php :: how to get category from post id 
Php :: last insert id model codeigniter 
Php :: laravel blade uppercase 
Php :: php get referral 
Php :: php check if file is video 
Php :: get image extension in php 
Php :: composer error installation 
Php :: php average from array 
Php :: check the php version in ubuntu 
Php :: enie letter validation laravel regex 
Php :: php string cut first x characters 
Php :: url encode php 
Php :: php foreach string char 
Php :: php unit skip test 
Php :: laravel publish email template 
Php :: key of last element php 
Php :: button back php 
Php :: php is string 
Php :: Enable / Disable modules in PHP 
Php :: install phpmyadmin ubuntu 
Php :: remove add media button wordpress editor 
Php :: laravel parse string to date 
Php :: codeigniter get user ip 
Php :: show php erros 
Php :: how to remove token while logout using laravel 8 
Php :: with in relation laravel 
Php :: php remove characters not numbers or letters 
Php :: The mysqli extension is missing. Please check your PHP configuration. 
Php :: set subject for mail inlaravel 
ADD CONTENT
Topic
Content
Source link
Name
4+3 =