Is there a simple way to scramble letters in a variable? If I have something like: $word='animal' and I get something like the: $word1='minala" Thanks
probably not. but this will do it <?PHP /** * @return string * @param string $word * @desc scrambles the word given. */ function scramble($word) { $newword = array(); for($i = 0; $i < strlen($word); $i++) { $num = rand(0, 100); $newword[$num] = substr($str, $i, 1); } ksort($newword); $output = implode('', $newword); return $output; } echo scramble('animal'); ?> Code (markup):