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\"
Use a regular expression and preg_replace
$correction = "game"; $text ="Hello this is an example of a \$word that starts with a \$dollar sign"; $text = preg_replace('/\$\w+/', $correction, $text); print $text;