Говномешалка

January 10, 2008

PHP скрипт, разбивающий текст нужным процентом кейворда.

define(’NEED_DENSITY’,20);

$key = "XANAX";
$body = "text about viagra here text about viagra here text about viagra here text about viagra here ";
$needDens = NEED_DENSITY;

$addKeysCnt =
($needDens/100)*(str_word_count($body)/str_word_count($key));
$arWords2 = explode(’ ‘,$body);
for($j=0;$j<$addKeysCnt;$j++) {
$arWords2[] = $key;
shuffle($arWords2);
}

$body = implode(’ ‘,$arWords2);

echo $body;

Comments »

The URI to TrackBack this entry is: http://intrex.blogsome.com/2008/01/10/p57/trackback/

No comments yet.

RSS feed for comments on this post.

Leave a comment

Line and paragraph breaks automatic, e-mail address never displayed, HTML allowed: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <code> <em> <i> <strike> <strong>



Anti-spam measure: please retype the above text into the box provided.