Jump to content

Generating Random Word


yakoup46

Recommended Posts

So this is the code i have...

 

$number = range('a','z');

$test = ($number[rand(0,25)]) . ($number[rand(0,25)]) . ($number[rand(0,25)]) . ($number[rand(0,25)]);

 

So if were to echo $test i would get four random letters. What i want to do is have it continue to generate random letters until it creates the word 'food'. I have absolutely no idea where to go from here. So any help would be awesome.

Link to comment
https://forums.phpfreaks.com/topic/154977-generating-random-word/
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.