时间:2021-07-01 10:21:17 帮助过:27人阅读
输出管道
- include("include/common.inc");
- $title = "Search";
- include("include/header.inc");
- ?>
- <P>
- <FORM ACTION=" echo "$PHP_SELF"; ?>" METHOD="POST">
- <INPUT TYPE="text" NAME="searchstr" value=" echo "$searchstr"; ?>"
- SIZE="20" MAXLENGTH="30">
- <INPUT TYPE="submit" VALUE="Search!">
- FORM>
- P>
- if ( ! empty($searchstr) )
- {
- // empty()用来检查查询字串是否为空
- // 如果不为空,调用grep查询
- echo "<HR>n";
- // 调用grep对所有文件进行大小写非敏感模式的查询
- $cmdstr = "grep -i $searchstr *";
- $fp = popen( $cmdstr, "r" ); // 执行命令并
怎么样,通过对上面这段代码的理解,新手们是否已经掌握了PHP实现站内搜索引擎的具体方法呢?
http://www.bkjia.com/PHPjc/446340.htmlwww.bkjia.comtruehttp://www.bkjia.com/PHPjc/446340.htmlTechArticle我们在实际的编码中,可以利用 以下就是PHP实现站内搜索引擎的具体代码: ? include ("include/common.inc"); $ title = "Search" ; include("include/header....