Home >php教程 >php手册 >ThinkPHP 3.1.3 实现网站查询数据关键字描红

ThinkPHP 3.1.3 实现网站查询数据关键字描红

WBOY
WBOYOriginal
2016-06-07 11:34:201508browse

ThinkPHP 3.1.3 实现网站查询数据关键字描红。开发疑难,功能开发,联系专业工程师 QQ467477957
查询逻辑:public function search_ok(){<br>     $Dao = M("shop");<br>     //echo $_POST[KeyWord];<br>     $where['name']=array('like',"%{$_POST[KeyWord]}%");<br>     $list = $Dao->where($where)->select();<br>     <br>     $this->assign("list", $list);<br>     //dump($list);<br>     $this->display('default/Index/search_ok');<br>     }模板输出替换:<volist> <br>           <li> <br>           <a>$vo['id']))}" target="_blank" title="{$vo.name}"><img alt="ThinkPHP 3.1.3 实现网站查询数据关键字描红" ></a><br>           <h4><a>$vo['id']))}" target="_blank" title="{$vo.name}"><!--{$vo.name}--><br>           <br>         <b> <?php $str=$vo[name]; $a="<b style=&#039;color:red;&#039;> $_POST[KeyWord]</b>";echo str_ireplace("$_POST[KeyWord]",$a,$str);?><br>           <br>           </a></h4> <br>             <div> <br>                 <p>¥<span>{$vo.price}.00</span></p> <br>             </div> <br>             <div> <br>                 <br>                 <br>                 <b>热荐</b><br>             </div> <br>           </li> <br>           </volist>ThinkPHP 3.1.3 实现网站查询数据关键字描红

AD:真正免费,域名+虚机+企业邮箱=0元

Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn