正则表达式后向引用
<!-- Code highlighting produced by Actipro CodeHighlighter (freeware) http://www.CodeHighlighter.com/ --> $reg = "/(\d{2})\/(\d{2})\/(\d{4})/e"; $text = '01/25/2009到02/02/2009'; $replace = "\${3},\${1}"; echo preg_replace($reg, $replace, $text);