此例中使用數(shù)組,怎么理解?
$patterns = array ('/(19|20)(\d{2})-(\d{1,2})-(\d{1,2})/',? '/^\s*{(\w+)}\s*=/');
$replace = array ('\3/\4/\1\2', '$\1 ='); ? ? ? ? ? ? ? ? ? ? ??
echo preg_replace($patterns, $replace, '{startDate} = 1999-5-27');?
此例中$patern和$replace是數(shù)據(jù),怎么理解呢?求高手講講。謝謝!
2016-07-12
(19|20)(\d{2})-(\d{1,2})-(\d{1,2})/',? '/^\s*{(\w+)}\s*匹配的應(yīng)該是這個:1990-11-1或者2001-5-1之類的