53.gif

Search (advanced search)
Use this Search form before posting, asking or make a new thread.
Tips: Use Quotation mark to search words (eg. "How To Make Money Online")

04-27-2019, 08:22 PM
Post: #1
PHP Article Spinner Code
Made this one for someone who requested it other people may want the code too

add reps say thanks

<?php




if (isset($_POST['submit'])) {
$content = $_POST['content'];





} else {

echo "Your form is not submitted yet please fill the form and visit again";
}


function spinaround($content)
{
preg_match_all('/{(.*)}/sU',$content,$matches);
foreach ($matches[0] as $k=>$v)
{
$string = $matches[1][$k];
if ( preg_match_all('/\[(.*)\]/sU',$string,$stringmatches) )
{
foreach ($stringmatches[0] as $l=>$w)
{
$new = explode('|',$stringmatches[1][$l]);
$new = $new[array_rand($new)];
$string = str_replace($w,$new,$string);
}
}
$new = explode('|',$string);
$new = $new[array_rand($new)];
$content = str_replace($v,$new,$content);
}
return $content;
}




?>

<!DOCTYPE html>
<html>
<body>

<h2>Article Spinner</h2>
<p>Enter Text To Spin</p>

<form name="form1" method="post" action="<?php echo $_SERVER['PHP_SELF']; ?>" >
<textarea name="content" style="width:100%; height:100%;">The {quick|fast} {brown|black} {fox|[fat|skinny] dog|cat} jumps
{over|above [and beyond|and below]|around} the {[overly|somewhat] lazy|sleepy}
{horse|cow|donkey}</textarea>
<br>
<input type="submit" name="submit">
</form>
<p>Article Spinner by FRED BEnt!</p>
<textarea name="content" style="width:100%; height:100%;"><?php echo spinaround($content);?></textarea>
</body>
</html>




32.gif