Random Characters
<?php
function randomchars($length){
$string = "";
for($i=1; $i<=$length; $i++){$string .= chr(rand(65,90));}
return $string;
}
?>
This function will create a random string that is x characters long.
It can be used for alot of things such as random key or password generation.
Example usage:
<?php
function randomchars($length){
$string = "";
for($i=1; $i<=$length; $i++){$string .= chr(rand(65,90));}
return $string;
}
?>
echo randomchars(32);
This will output a string like this:
WYRYZQKDWVRTZRSPHSGAFCMWUJDMLRKS
