<?php

$internal_message = 'Hey, this is awesome!';

$words = array(
    'wesome' => 'wful',
    'wful' => 'wesome',
    'this' => 'that',
    'that' => 'this'
);
$rx = '~(?:' . implode("|", array_keys($words)) . ')\b~';
echo "$rx\n";
$message = preg_replace_callback($rx, function($m) use ($words) {
	return isset($words[$m[0]]) ? $words[$m[0]] : $m[0];
}, $internal_message);
echo $message;