It seems you really don't have a special template, why not just use preg_replace?
$search = array('/ibm/i', '/hpspecial/i'); $replace = array('IBM', 'HPspecial'); $string = preg_replace($search, $replace, $string);
You should still do this because you cannot tell HP from Special (at least in simple ways);
You can use the same approach using str_replace in fact, since you are not using complex templates as far as I can see.
Sometimes the easiest solution is the best
source share