Forum Moderators: coopster

Message Too Old, No Replies

How to randomize characters of a word

You know.. just move the letters around

         

russkern

3:55 am on Jan 4, 2009 (gmt 0)

10+ Year Member



Does anyone know of a good way to accomplish this?

Very simply, the user inputs a word, hits submit, and it reports back the word all mixed up.

i.e. "tops" >becomes>>> "opts"

The form an all is easy enuf... just struggling to understand how to randomize the characters.

Any help is greatly appreciated.

R

eelixduppy

4:29 am on Jan 4, 2009 (gmt 0)




echo [url=http://www.php.net/str-shuffle]str_shuffle[/url]($word);

:)

russkern

4:35 am on Jan 4, 2009 (gmt 0)

10+ Year Member



:) thanks,

I was just logging in to say I just found that as well...

Russ

eelixduppy

4:42 am on Jan 4, 2009 (gmt 0)



[php.net...] is always the place to check first if you are looking for a function like that. Glad you found it, though. :)