View Full Version : Creating an algorithm

08-25-2005, 02:10 AM
I am trying to create an algorithm that takes words from a set of 10-20 words and puts them into any 3-10 word combination, not permutation. I know nothing of scripting and dont even really know if this is the right forum to post into. Any help is greatly appreciated. Thank you.

08-25-2005, 04:10 AM

function randString($wordArray) {
if(!is_array($wordArray)) { return false; }
$length = rand(3,10);
$string = array();
for($i=0; $i <= $length; $i++)
$string[$i] = $wordArray[array_rand($wordArray)];
return implode(' ', $string);

EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum