$text = preg_replace("/>(?!<\w+[^<]*)($needle)(?!<*)/i","<span style=\"background:#FFFF9F\">\\1</span>", $haystack);