note 8574 added to preg_replace

From: Date: Mon, 18 Sep 2000 05:14:49 +0000
Subject: note 8574 added to preg_replace
Groups: php.notes 
Request: Send a blank email to php-notes+get-5163@lists.php.net to get a copy of this message
I felt it necessary to point out that Example 1 above does not work correctly. The first line should be: $patterns = array ("/(19|20)(\d{2})-(\d{1,2})-(\d{1,2})/", "/^\s*{(\w+)}\s*=/"); and the line after that should be: $replace = array ("\\3/\\4/\\1\\2", "$\\1 ="); THIS will produce the desired results: $startDate = 5/27/1999 http://www.php.net/manual/function.preg-replace.php

« previous php.notes (#5163) next »