$string = "April 15, 2003";
$pattern = "/(\w+) (\d+), (\d+)/i";
$replacement = "\${1}1,\${3}";
print preg_replace($pattern, $replacement, $string);
//April1,2003
转载于:https://www.cnblogs.com/7bus/archive/2011/08/02/2124823.html
$string = "April 15, 2003";
$pattern = "/(\w+) (\d+), (\d+)/i";
$replacement = "\${1}1,\${3}";
print preg_replace($pattern, $replacement, $string);
//April1,2003
转载于:https://www.cnblogs.com/7bus/archive/2011/08/02/2124823.html