PHP generates random strings
You can specify whether it is a pure number or a pure letter or a mixture.
You can specify the length of the.
Copy CodeThe code is as follows:
function Rand_zifu ($what, $number) {
$string = ";
for ($i = 1; $i <= $number; $i + +) {
Mixed
$panduan = 1;
if ($what = = 3) {
if (rand) ==1 {
$what = 1;
}else{
$what = 2;
}
$panduan = 2;
}
Digital
if ($what ==1) {
$string. =rand (0,9);
}elseif ($what ==2) {
Letters
$rand =rand (0,24);
$b = ' a ';
for ($a =0; $a <= $rand; $a + +) {
$b + +;
}
$string. = $b;
}
if ($panduan ==2) $what = 3;
}
return $string;
}
echo Rand_zifu (3,10);
http://www.bkjia.com/PHPjc/756339.html www.bkjia.com true http://www.bkjia.com/PHPjc/756339.html techarticle PHP generates random strings that can be specified as pure numbers or as pure letters or mixed. You can specify the length of the. Copy the code code as follows: function Rand_zifu ($what, $number) {$string = ...