ªð¦^¦Cªí ¤W¤@¥DÃD µo©«

6-4-1 ¹Ï§Î­p¼Æ¾¹

6-4-1 ¹Ï§Î­p¼Æ¾¹

6-4-1   ¹Ï§Î­p¼Æ¾¹
¤å¦r«¬­p¼Æ¾¹¬Ý°_¨Ó¦n¹³³æ½Õ¤F¤@ÂI¡A§Ú­Ì¦ó¤£±N¥¦§ï¦¨¹Ï¤ù¦¡ªº¹Ï§Î­p¼Æ¾¹¡A¤é«á¦pªG·Q´«´«¤f¨ýªº¸Ü¡Aª½±µ±N¹ÏÀÉ´«±¼´N¦æ¤F¡I

¹Ï6-28  ¹Ï¤ù¦¡­p¼Æ¾¹¡C

¦b¼¶¼gµ{¦¡¤§«e¡A½Ð¥ý·Ç³Æ¦n¥Nªí0~9ªº¼Æ¦r¹Ï¤ù¡AÀɦW¸ò¹Ï¤ùªº¤º®e¼Æ¦r¥²¶·¬Û²Å¡G

¬°¤F±N­p¼ÆÀɮפºªº¸ê®Æ¨ú¥X¨Ó¨ÃÂà´«¬°¹Ï¤ù¡A§Ú­Ì¥²¶·±N¼Æ¦rªº¨C¤@­Ó¡u¦r¡v©î¸Ñ¥X¨Ó¡A¨Ã¥H¹Ï¤ùÀɦW´À¥N¡G
  1. <?
  2. function picout($num)
  3. {
  4. $strlen=strlen($num);
  5. for ($x=0;$x<$strlen;$x++)
  6.   {
  7.    $picnum=substr($num,$x,1);
  8.     echo "<img src=$picnum.gif>";
  9.   }
  10. }
  11. ?>
½Æ»s¥N½X

  • µ{¦¡½X²Ä4¦æ¡G¥ý§Q¥Îstrlen()¨ç¼Æ­pºâ¦r¦êªºªø«×¡]­p¼Æ¸ê®Æªº¦ì¼Æ¡^¡C
  • µ{¦¡½X²Ä5~9¦æ¡G¨Ï¥Îfor°j°é±N¦U­Ó¹Ï¤ùÀɪºHTML¼ÐÅÒ±Ô­z¿é¥X¡C
  • §Q¥Îsubstr()¨ç¼Æ©î¸Ñ¦r¦ê¡A¨C¦¸¨ú¥X¤@­Ó¦r¤¸¡C
¤ß¦w¡A¥­¦w   
µoªí¥ô¦óµL·N¸qªº·PÁ©ÎÄé¤ô¤å³¹¤@«ß¬å,¬Ã±¤±b¸¹,½Ð¸Ô¾\ª©³W!!

¬°¤F¤£ÅÜ°Ê­ì©lªº¤å¦r­p¼Æ¾¹¥\¯à¡A©Ò¥H¤p»x§â¤å¦rÂà´«¦¨¹Ï¤ùHTML¼ÐÅÒ±Ô­zªºµ{¦¡°Ï¶ô¥Î¨ç¼Æ¥]°_¨Ó¡A©Ò¥H§Ú­Ì¥u­n±N¥»¨Ó¿é¥X¤å¦r¸ê®Æªº¦a¤è§ï¦¨©I¥s°Æµ{¦¡§Y¥i¡C
piccount.php
  1. <?
  2. $countfile="piccount.txt";
  3. global $num;
  4. if (file_exists($countfile))
  5.    {
  6.     $file=fopen($countfile,"r");
  7.     $num=fgets($file,filesize($countfile)+1);
  8.     $num++;
  9.     fclose($file);
  10.    }
  11. else
  12.    {
  13.     $num="1";
  14.    }
  15. $file=fopen($countfile,"w");
  16. fwrite($file,$num);
  17. fclose($file);
  18. ?>

  19. <html>
  20. <head>
  21. <meta http-equiv="Content-Language" content="zh-tw">
  22. <meta http-equiv="Content-Type" content="text/html; charset=big5">
  23. <title>¹ê¥Îªº¹Ï¤ù­p¼Æ¾¹</title>
  24. </head>
  25. <body>
  26. <p align="center"><font size="5">¹ê¥Îªº¹Ï¤ù¦r­p¼Æ¾¹</font></p>
  27. <hr>
  28. <p align="center"><b><font color="#FF0000">
  29. °ÑÆ[¤H¦¸:<?=picout($num)?></font></b></p>
  30. </body>
  31. </html>

  32. <?
  33. function picout($num)
  34. {
  35. $strlen=strlen($num);
  36. for ($x=0;$x<$strlen;$x++)
  37.   {
  38.    $picnum=substr($num,$x,1);
  39.     echo "<img src=$picnum.gif>";
  40.   }
  41. }
  42. ?>
½Æ»s¥N½X
¤ß¦w¡A¥­¦w   
µoªí¥ô¦óµL·N¸qªº·PÁ©ÎÄé¤ô¤å³¹¤@«ß¬å,¬Ã±¤±b¸¹,½Ð¸Ô¾\ª©³W!!

TOP

¥t¸Ñ¡G
Piccount_2.php
  1. <?
  2. $countfile="piccount.txt";
  3. if (file_exists($countfile))
  4.    {
  5.     $file=fopen($countfile,"r");
  6.     $num=fread($file,filesize($countfile));
  7.     $num++;
  8.     fclose($file);
  9.     $file=fopen($countfile,"w");
  10.     fwrite($file,$num);
  11.     fclose($file);
  12.    }
  13. else
  14.    {
  15.     $num=1;
  16.     $file=fopen($countfile,"w");
  17.     fwrite($file,$num);
  18.     fclose($file);
  19.    }
  20. ?>

  21. <html>
  22. <head>
  23. <meta http-equiv="Content-Language" content="zh-tw">
  24. <meta http-equiv="Content-Type" content="text/html; charset=big5">
  25. <title>¹ê¥Îªº¹Ï¤ù­p¼Æ¾¹</title>
  26. </head>
  27. <body>
  28. <p align="center"><font size="5">¹ê¥Îªº¹Ï¤ù¦r­p¼Æ¾¹</font></p>
  29. <hr>
  30. <p align="center"><b><font color="#FF0000">
  31. °ÑÆ[¤H¦¸:<?=picout()?></font></b></p>
  32. </body>
  33. </html>

  34. <?
  35. function picout()
  36. {
  37. global $countfile;
  38. $file=fopen($countfile,"r");
  39. while (false != ($char = fgetc($file)))
  40.   {
  41.      echo "<img src=" . $char . ".gif>";
  42.   }
  43. fclose($file);
  44. }
  45. ?>
½Æ»s¥N½X
¤ß¦w¡A¥­¦w   
µoªí¥ô¦óµL·N¸qªº·PÁ©ÎÄé¤ô¤å³¹¤@«ß¬å,¬Ã±¤±b¸¹,½Ð¸Ô¾\ª©³W!!

TOP

        ÀR«ä¦Û¦b : ­ì½Ì§O¤H´N¬Oµ½«Ý¦Û¤v¡C
ªð¦^¦Cªí ¤W¤@¥DÃD