PHP8.1.21版本已发布
vue8.1.21版本已发布
jquery8.1.21版本已发布

站内搜索HTML版_PHP教程

原创
2016-07-13 17:42:37 876浏览

 

  1. /****************************************************     
  2. program : Spr2[search_html]     
  3. Author  : uchinaboy      
  4. E-mail  : uchinaboy@163.com     
  5. QQ      : 16863798     
  6. Date    : 2001-8-9    
  7. ****************************************************/    
  8. //require("config.inc.php");    
  9.  
  10. function get_msg($path) {    
  11. global $key$i;    
  12. $handle = opendir($path);    
  13. while ($filename = readdir($handle)) {    
  14. //echo $path."//m.sbmmt.com/m/".$filename."
    ";  
     
  15. $newpath = $path."//m.sbmmt.com/m/".$filename;    
  16. $check_type = preg_match("/.html?$/"$filename);    
  17. if (is_file($newpath) && $check_type) {    
  18. $fp = fopen($newpath"r");    
  19. $msg = fread($fpfilesize($newpath));    
  20. fclose($fp);    
  21. match_show($key$msg$newpath$filename);    
  22. }    
  23. if (is_dir($path."//m.sbmmt.com/m/".$filename) && ($filename != ".") &&  ($filename != "..")) {    
  24. //echo "


    ".$newpath."


    ";  
     
  25. get_msg($path."//m.sbmmt.com/m/".$filename);    
  26. }    
  27. }    
  28. closedir($handle);    
  29. return $i;    
  30. }    
  31.  
  32. function match_show($key$msg$newpath$filename) {    
  33. global $key$i;    
  34. $key = chop($key);    
  35. if ($key) {    
  36. $msg = preg_replace("//is"""$msg);    
  37. $msg = str_replace(" """$msg);    
  38. $msg = preg_replace("/]+>/"""$msg);    
  39. $value = preg_match("/.*$key.*/i"$msg$res);    
  40. if ($value) {    
  41. $res[0] = preg_replace("/$key/i""$key"$res[0]);    
  42. $i++;    
  43. $link = $newpath;    
  44. print "$filename
    "
    ;    
  45. print $res[0].

    www.bkjia.comtruehttp://www.bkjia.com/PHPjc/486037.htmlTechArticle?php /**************************************************** program:Spr2[search_html] Author:uchinaboy E-mail:uchinaboy@163.com QQ:16863798 Date:2001-8-9 ***************************...
声明:本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系admin@php.cn核实处理。