codice:
$text = 'EMFQEOMFQ 034210 QMEIMFOQIEFNEQI 130341 NOQIEFNEQIFN';

preg_match_all('/\D\d{6}\D/', $text, $match);

$from = $match[0];
$to   = array_map('transform', $from);

echo str_replace($from, $to, $text);

function transform($s) {
	$letters = 'abcde';
	$numbers = '03421';
	return strtr($s, $numbers, $letters);
}