// Retrieve fields from form
$text = $_POST['stuff']; // keep intact for text field
// Here's where the "magic" happens...
if (isset($text)) {
// Replace any instance of the word "talk" with "jibberish"
$pattern = '/talk/';
$replacement = 'jibberish';
$newtext = preg_replace($pattern, $replacement, $text);
}
?>
<?php
// If we've got new text, display it
if (isset($newtext)) {
echo "<br>"; // not sure why to echo break tags?? ask dan
echo $newtext;
}
?>