PHP guessing word games, php guessing words
Just copy it locally and run it.
<?phpsession_start (); Header ("content-type:text/html;charset=utf-"); $url = ' http://' $_server[' http_host ']$_ server[' php_self '];function Get_word () {$wordtext = "redistribution and use of source and binary forms, with or without modif Ication, is permitted provided that the following conditions is met:redistributions of source code must retain the above Copyright notice, this list of conditions and the following disclaimer redistributions in binary form must reproduce the Above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials P Rovided with the distribution neither the name of the YII software LLC or the names of its contributors could be used to endors E or promote products derived from the software without specific prior written permission this software was provided by TH E COPYRIGHT Holders and CONTRIBUTORS as is and any EXPRESS OR implied warranties, including, but not LIMITED to, the Impli ED warranties of merchantability and FITness for A particular PURPOSE is disclaimed in NO EVENT shall the COPYRIGHT OWNER OR CONTRIBUTORS is liable for any DIRE CT, INDIRECT, incidental, special, exemplary, OR consequential damages (including, but not LIMITED to, procurement of SUBS Titute GOODS OR SERVICES; LOSS of Use, DATA, OR profits; or business interruption) however caused and on any theory of liability, WHETHER in contract, STRICT liability, OR TORT (I ncluding negligence OR OTHERWISE) arising in any-out-of-the---the-software, even IF advised of the possibility O F SUCH DAMAGE "; $words =preg_split ("/[\s,]+/", $wordtext);d o{$i =rand (, Count ($words)-); $word =strtoupper ($words [$i]);} while (strlen ($word) < | |!ctype_alpha ($WORD)); return $word;} function Guess ($word) {return Str_repeat (' _ ', strlen ($word));} function output ($word) {$str = '; for ($i =; $i
<?phpif (!isset ($_session[' num ')) {echo '
Easy:wrong
'; Echo '
Normal:wrong
'; Echo '
Hard:wrong
';} Else{//echo $word; echo "Can guess the most wrong" $_session["num" "Times"; echo "
"echo" "; Echo output ($guess _word); echo" "; echo"
'; Echo '; for ($i =ord (' A '); $i <=ord (' Z '); + + $i) {echo "\ n"; $letter =chr ($i); Echo '
' $letter '';} echo '; Echo '
'; Echo '
'; Echo '; Echo '
'; Echo '
' Echo ' begins again '; >
This is a PHP implementation of the word guessing game, I hope you can extrapolate, realize other small games, proficiency in PHP programming.
http://www.bkjia.com/PHPjc/1058163.html www.bkjia.com true http://www.bkjia.com/PHPjc/1058163.html techarticle PHP guess word game, PHP guess the word directly copy local run can be Phpsession_start (); Header ("content-type:text/html;charset=utf-"); $url = ' http://' $_server[' http_host ']$_server[ ...