Php String Random

[Solved] Php String Random | Php - Code Explorer | yomemimo.com
Question : PHP random string generator

Answered by : code-grepper

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

Source : | Last Update : Wed, 06 Nov 19

Question : random string php

Answered by : mysterious-markhor-95z45gee1z7d

<?php $random = substr(md5(mt_rand()), 0, 7); echo $random;
?>

Source : https://stackoverflow.com/questions/4356289/php-random-string-generator | Last Update : Tue, 28 Apr 20

Question : php random string

Answered by : -n746j61qvtgj

function rand_str() { $characters = '0123456789-=+{}[]:;@#~.?/&gt;,&lt;|\!"£$%^&amp;*()abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ'; $randomstr = ''; for ($i = 0; $i < random_int(50, 100); $i++) { $randomstr .= $characters[rand(0, strlen($characters) - 1)]; } return $randomstr; }

Source : | Last Update : Sat, 10 Oct 20

Question : generate random string php

Answered by : rohit-ghodadra

function RandomString($length = 10) { return substr(str_shuffle(str_repeat($x='0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ', ceil($length/strlen($x)) )),1,$length);
}
echo RandomString(); 

Source : | Last Update : Mon, 21 Mar 22

Question : Generate Random String in PHP

Answered by : pawan-mall

phpCopy<?php
$Random_str = uniqid();
echo "Random String:", $Random_str, "\n";
?> 

Source : https://www.delftstack.com/howto/php/php-generate-random-string/ | Last Update : Fri, 30 Apr 21

Question : php random string

Answered by : janole-michael

function generateRandomString($digits) { $characters = '0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ'; $randstring = ''; for ($i = 0; $i < $digits; $i++) { $randstring .= $characters[rand(0, strlen($characters))]; } return $randstring;
}
echo generateRandomString(24);

Source : | Last Update : Mon, 17 Jan 22

Question : Generate Random String in PHP

Answered by : pawan-mall

phpCopy<?php
echo uniqid('user_');
?> 

Source : https://www.delftstack.com/howto/php/php-generate-random-string/ | Last Update : Fri, 30 Apr 21

Question : random string in php

Answered by : lovely-lemur-ozqs9dgsnbin

$len = 9;
$random = str_shuffle(sub_str('ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz1234567890', 10, $len));

Source : | Last Update : Thu, 10 Feb 22

Question : Generate Random String in PHP

Answered by : pawan-mall

phpCopy<?php
echo "Out1: ",substr(md5(time()), 0, 16),"\n";
echo "Out2: ",substr(sha1(time()), 0, 16),"\n";
echo "Out3: ",md5(time()),"\n";
echo "Out4: ",sha1(time()),"\n";
?>

Source : https://www.delftstack.com/howto/php/php-generate-random-string/ | Last Update : Fri, 30 Apr 21

Question : generate random string php

Answered by : mukash-wasti

function gen_uid($l=5){ return substr(str_shuffle("ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789"), 10, $l);
}
echo gen_uid();

Source : https://stackoverflow.com/questions/4356289/php-random-string-generator | Last Update : Wed, 28 Sep 22

Answers related to php string random

Code Explorer Popular Question For Php