Its very basic code. But maybe someone can use it.
Input:
{Hello|Hi|Hei} {word|wj|google|mate} !
Output:
Input:
{Hello|Hi|Hei} {word|wj|google|mate} !
Output:
- Hei mate !
- Hi wj !
- Hi google !
- Hello word !
PHP:
<?php
set_time_limit(0);
if(!isset($_POST['run']))
{
?>
<h1>Spin it.</h1>
<form action="" method="post">
<label>Your Article:<br>
<textarea name="content" cols="60" rows="20"></textarea>
</label><br><br>
<input type="hidden" name="run" value="run" />
<input name="submit" type="submit" id="submit" value="SPIN ARTICLE" />
</form>
<?php
}else{
function spinner($text) {
$txt = preg_split("/{|}/", $text);
foreach($txt as $key => $t){
if($key%2){
$spin = preg_split("/\|/", $t);
$txt[$key] = $spin [mt_rand(1,count($spin)-1)];
}
}
$string = implode("", $txt);
return $string;
}
echo spinner($_POST['content']);
}
?>