1
2<?php
3$string = 'April 15, 2003';
4$pattern = '/(\w+) (\d+), (\d+)/i';
5$replacement = '${1}1,$3';
6echo preg_replace($pattern, $replacement, $string);
7
1preg_replace($pattern, $replacement, $subject [, $limit [, &$count]]);
2// Returns an array if the subject parameter is an array,
3// or a string otherwise.
4// If matches are found, the new subject will be returned, otherwise
5// subject will be returned unchanged or NULL if an error occurred.