织梦DedeCMS文章标题如何随机自动增加长尾关键词?

请教大神,织梦DedeCMS文章标题自动增加长尾关键词的方法。用这个的话 文章标题后是A B C D关键字全展现了。如何实现关键字 A B C D 随机展现一个?

if ( ! function_exists('wordtitle'))
{
function wordtitle($title) {
static $arr = array('A, 'B', 'C', 'D');
$return = '';
foreach ($arr as $value)
{ $return .= $title . $value;
}
return $return;
}
}

这个好弄,弄个0-3的随机数然后输出数组即可。

if ( ! function_exists('wordtitle'))
{
function wordtitle($title) {
static $arr = array('A', 'B', 'C', 'D');
echo $arr[rand(0,3)];
return $return;
}
}
温馨提示:内容为网友见解,仅供参考
无其他回答
相似回答