seo文章内容添加干扰字符
做了这么久的seo了 ,百度收录一直是个问题 。文章添加干扰码目的是为了增加原创性,更好的达到百度收录效果。
function rep_code(&$html)
{
$html= preg_replace_callback("/(,|?|。|:|、)/", function ($ms)
{
$c = mt_rand(3, 3);//数字自定义
$t = '';
for ($i = 0; $i < $c; $i ++) {
$t .= chr(mt_rand(5, 8));
}
if (mt_rand(0, 100) > -1) {
return $t . $ms[0];
} else {
return $ms[0];
}
}, $html);
echo $html;
}
{{file ascii.php}}
{{$article['content']|rep_code()}}