X-Git-Url: https://jasonwoof.com/gitweb/?p=wfpl.git;a=blobdiff_plain;f=time.php;h=f71d22a0b6789157f8eb57eb7acecab3fb64aafc;hp=3c42f79dbde7d354e02f4f1c903b3102e6bbedc2;hb=196deb2416748b09200f620247a344563dff4c38;hpb=26bad7e66d87374bed4f126c7f202133828e387c diff --git a/time.php b/time.php index 3c42f79..f71d22a 100644 --- a/time.php +++ b/time.php @@ -76,8 +76,8 @@ function clean_ymd($year, $month, $day) { # pass date like 3/21/99 # returns array(year, month, day) function mdy_clean($date) { - $date = ereg_replace('[^0-9/-]', '', $date); - $date = ereg_replace('-', '/', $date); + $date = preg_replace('|[^0-9/-]|', '', $date); + $date = preg_replace('|-|', '/', $date); $parts = explode('/', $date); switch(count($parts)) { case 1: @@ -108,8 +108,8 @@ function mdy_to_ymd($date) { # pass date like 2008-11-21 # returns array(year, month, day) function ymd_clean($date) { - $date = ereg_replace('[^0-9/-]', '', $date); - $date = ereg_replace('/', '-', $date); + $date = preg_replace('|[^0-9/-]|', '', $date); + $date = preg_replace('|/|', '-', $date); $parts = explode('-', $date); switch(count($parts)) { case 1: