how to generate random word php code example
Example 1: random word using a wordlist php
$file = file('File Location');
$wCount = count($file);
echo $file[rand(0, $wCount - 1)];
echo file('File Location')[rand(0, count(file('File Location')) - 1)];
Example 2: rand string php
function RandomString()
{
$characters = '0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ';
$randstring = '';
for ($i = 0; $i < 10; $i++) {
$randstring = $characters[rand(0, strlen($characters))];
}
return $randstring;
}