先看一个例子: <?php $string = 'April 15, 2003'; $pattern = '/(\w+) (\d+), (\d+)/i'; $replacement = '${1}1,$3'; echo preg_replace($pattern, $replacement, $string); ?> 例子的结果是:April1,2003 函数preg_replace ( mixed pattern, mixed replacement, mixed subject [, in…