PDA

View Full Version : Really hard Stuff..


RenegadeLeader
11-14-2003, 08:07 PM
Well, i decided to make a script, that you can play Hang-Man on!
Yada yada yada.. But im stuck. I need to be able to pull the word from a DB(already done) but the hard part is, the user has to be able to Guess that word through letters..

Is there a way u can split that word up? Maybe like a search function, er something?:(

EnwTheGood
11-14-2003, 08:46 PM
I believe you're looking for str_split(), which turns "String!" into {"S","t","r","i","n","g","!"}. However, I would just use the stristr function, which is a case-insensitive searche for a string inside another string.

For instance, if they guess A and the word is hangman, stristr("hangman","A") would return "angman". If the word was "Bob Hope", it would return FALSE.

Hope this helps!

I can barely keep track of my usernames anymore, and it's not written on this page anywhere, so this post is from
-Me

RenegadeLeader
11-15-2003, 05:46 PM
i Dont know, i looked up at php.net, and it looks compliacted, and doesnt look like wut im looking for. :(