php内容添加ascii干扰字符

12 / Jan / 2022 PM Note 72

php内容添加ascii干扰字符的方法:增加文章内容伪原创,有利于百度收录,从而达到原创文章内容

php内容添加ascii干扰字符

代码:

<?php
/**
 * @Author: TIM
 * @Date:   2022-01-12 14:31:12
 * @Email:  61468384@qq.com
 * @Blog:   http://www.tim-blog.com
 * @Desc:   简单即是美 Simple is beautiful...
 * @Last Modified by:   1
 * @Last Modified time: 2022-01-12 21:45:00
 */
function clfh($content) {
	$m_content = thfh($content);
	while(strstr($m_content,'{dh}')) {
		$luanma = qu_luanma();
		$m_content = preg_replace('/{dh}/',$luanma .',',$m_content,1);
	}
	while(strstr($m_content,'{jh}')) {
		$luanma = qu_luanma();
		$m_content = preg_replace('/{jh}/',$luanma .'。',$m_content,1);
	}
	while(strstr($m_content,'{fh}')) {
		$luanma = qu_luanma();
		$m_content = preg_replace('/{fh}/',$luanma .';',$m_content,1);
	}
	while(strstr($m_content,'{duh}')) {
		$luanma = qu_luanma();
		$m_content = preg_replace('/{duh}/',$luanma .'、',$m_content,1);
	}
	while(strstr($m_content,'{gth}')) {
		$luanma = qu_luanma();
		$m_content = preg_replace('/{gth}/',$luanma .'!',$m_content,1);
	}
	while(strstr($m_content,'{mh}')) {
		$luanma = qu_luanma();
		$m_content = preg_replace('/{mh}/',$luanma .':',$m_content,1);
	}
	return $m_content;
}
function qu_luanma() {
	$luanma_array = array('','','','');
	$luanma = '';
	for ($i=0;$i<mt_rand(2,5);$i++) {
		$luanma .= $luanma_array[mt_rand(0,count($luanma_array)-1)];
	}
	return $luanma;
}
function thfh($content) {
	$content = preg_replace('/,/','{dh}',$content);
	$content = preg_replace('/。/','{jh}',$content);
	$content = preg_replace('/;/','{fh}',$content);
	$content = preg_replace('/、/','{duh}',$content);
	$content = preg_replace('/!/','{gth}',$content);
	$content = preg_replace('/:/','{mh}',$content);
	return $content;
}

说明:前台页面就不展示了 。前面有类似的案例

发布评论

© TIM All Rights Reserved sitemap

🌈Theme by TIM