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\"
Something like so:
preg_replace("/(\w*)$([a-z]+)/i", "$1$correction", $text);
Note: I haven't tried it so my regex may be slightly flawed.