Anyone 'd like to share a free and simple php content spinner script?

tpaolo

Regular Member
Joined
May 28, 2009
Messages
333
Reaction score
45
Hi, I've been looking here and on google for a simple content spinner php script that uses "pipes" to random words/phrases online generation, but dind't found it.

Also looking for a no professional one, only a script that some php programmer here could have coded without commercial purposes.

I'd like to add it to my webmaster's resources page for public usage, I can give a backlink to donator.

Thanks.
 
Yes, but I'd like to download it and use it on my site
 
Here is a function to do that.
Code:
http://www.alexpoole.name/seo/155/simple-php-article-spinner
Uses commas to delimiter, but could be modified to use pipes.
 
Hello,

i hope this would help you

<?php
mt_srand(crc32($_SERVER['REQUEST_URI'])));
?>

Here?s the function:
<?php function Spin($txt){
$test = preg_match_all("#\{(.*?)\}#", $txt, $out);
if (!$test) return $txt;
$toFind = Array();
$toReplace = Array();
foreach($out[0] AS $id => $match){
$choices = explode(?|?, $out[1][$id]);
$toFind[]=$match;
$toReplace[]=trim($choices[rand(0, count($choices)-1)]);
}
return str_replace($toFind, $toReplace, $txt);
}
?>
You use it like this:
<?php
$text = "The {quick|slow|reasonably paced} {brown|green|blue|pink} {fox|goat|rat|camel}
{jumped|walked|hopped} {over|past|under} the {lazy|tired|boring} {dog|cat|stoat}";
$count = 0;
while ($count++ < 100){
echo Spin($text);
echo "<br />";
}
?>
 
Back
Top