Trying to get this article spinning script to work, not sure what I am doing wrong… keep in mind I am new to this…
<html>
<head>
<title>test</title>
</head>
<body>
<form method="post" action="spin.php">
Message:<br />
<textarea id="txt" name="txt" rows="15" cols="40">
</textarea><br />
<input type="submit" />
</form>
</body>
</html>
[php]
<?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); } ?>[/php]