$find="this string is my find"; $string='<font color="red">替换掉了</font>';//将超链接替换成的内容 echo ereg_replace('<a([^>]*)>([^<]*'.$find.'[^>]*)</a>','<font color="red">\\2</font>',$content);