Hi, I am looking for a php script for parsing out spintax. Or at least directions on where I should start for making my own. Thanks, Michael
function spin($var){ $spun = ""; $words = explode("{",$var); foreach ($words as $word) { $words = explode("}",$word); foreach ($words as $word) { $words = explode("|",$word); $word = $words[array_rand($words, 1)]; $spun .= $word." "; } } return $spun; } USAGE: echo spin("This is {my|your|yours|the} text that came after being spun!");