Jump to content


Photo

Scramble


  • Please log in to reply
2 replies to this topic

#1 ItsWesYo

ItsWesYo
  • Members
  • PipPipPip
  • Advanced Member
  • 110 posts

Posted 25 July 2006 - 07:41 PM

By now, you're probably thinking that I'm annoying you with these basic questions >_>

Anyway, how would I go about making a simple word scramble code?

#2 ryanlwh

ryanlwh
  • Staff Alumni
  • Advanced Member
  • 511 posts

Posted 25 July 2006 - 07:49 PM

split the words into an array with explode() and use shuffle()
$str = "this is a test";
$words = explode(' ',$str);
shuffle($words);
echo implode(' ',$words);

Please use EDIT * 100...
Please use
or [php] * 1000...

PLEASE READ THE POSTED SOLUTIONS CAREFULLY * 1000000...

#3 effigy

effigy
  • Staff Alumni
  • Advanced Member
  • 3,600 posts
  • LocationIL

Posted 25 July 2006 - 07:54 PM

str_shuffle
Regexp | Unicode Article | Letter Database
/\A(e)?((1)?ff(?:(?:ig)?y)?|f(?:ig)?)\z/




0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users