here is a simple example:
$correction = \"game\"; $text =\"Hello this is an example of a $word that starts with a $dollar sign\"; $text = str_replace(\"\\$word\"
You'll need a regex for this:
$text = preg_replace( '/\$[a-z]+/i', 'game', $text);