Home >php教程 >php手册 >php过滤字符串内容的

php过滤字符串内容的

WBOY
WBOYOriginal
2016-05-25 16:56:441234browse

下面举了二个实现来告诉你如何过滤重复的内容,有需要的朋友可以参考

 

foreach($arr as $value){ 
   if(!empty($value)){ 
     $strs=strstr($value,"新闻");
   }
}

输出:新闻 新闻

直接用array_unique 函数就可以了。

 

$string= '数组aabbccdd'; 
function str_split_utf8($str) { 
$split=1; 
$array = array(); 
for ( $i=0; $i  127){ 
if($value >= 192 && $value = 224 && $value = 240 && $value <p><br>这里有篇参考文章</p><p>php教程er/21/899e11a21ae817a97d3ce64f851ab9f6.htm">http://www.phprm.com/phper/21/899e11a21ae817a97d3ce64f851ab9f6.htm</p><div class="ad_580" id="ad_580"></div> <p>本文地址:</p><p>转载随意,但请附上文章地址:-)</p> 
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