Home  >  Article  >  Backend Development  >  php验证一个页面里面是否包涵一个特定的内容,该怎么处理

php验证一个页面里面是否包涵一个特定的内容,该怎么处理

WBOY
WBOYOriginal
2016-06-13 10:17:191205browse

php验证一个页面里面是否包涵一个特定的内容
就是做一个提交表单,把多个网址提交给php处理,判断这个网址的内容里面是否包涵一个特定的句子.并把这个网址和数据库里的网址做一下比对,看数据库是否存在这个地址.两个都符合的弹出提示通过,不符合的提示失败.
请问可以帮忙下吗

------解决方案--------------------

PHP code
你可以把你数据中的网址放入一个数组中。假设为$arrif(strpos(file_get_contents($_POST['url']),'特定的句子') !==false && in_array($_POST['url'],$arr)){           echo '通过';   }else{           echo "不通过";}<br><font color="#e78608">------解决方案--------------------</font><br>有<input type="text" name="url[]">?<br><br>print_r($_POST); 看有没数据<div class="clear">
                 
              
              
        
            </div>
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