function my_parse_date ($date) { $month_arr = array ( "january" => 1, "february" => 2, "march" => 3, "april" => 4, "may" => 5, "june" => 6, "july" => 7, "august" => 8, "september" => 9, "october" => 10, "november" => 11, "december" => 12, "januari" => 1, "februari" => 2, "maart" => 3, "mei" => 5, "juni" => 6, "juli" => 7, "augustus" => 8, "oktober" => 10 ); sscanf ($date, "%d", $v); #echo "V= $v\n"; if ($v > 1) return $date; $date = strtolower ($date); if (preg_match('/([a-zA-Z]{3,9}) ([0-9]{1,2})[sth]*, ([0-9]{4})/', $date, $matches2) == 1) { #echo "engelse datum: $matches2[3] . $matches2[2]. $matches2[1] \n" ; return sprintf ("'%04d-%02d-%02d'", $matches2[3], $month_arr[$matches2[1]], $matches2[2]); } if (preg_match('/([0-9]{1,2}) ([a-z]{3,9}) ([0-9]{4})/', $date, $matches2) == 1) { #echo "nl datum: $matches2[3] . $matches2[2]. $matches2[1] \n" ; #echo "returning: ". sprintf ("%04d-%02d-%02d", #$matches2[3], $month_arr[$matches2[2]], $matches2[1]) . "\n" ; return sprintf ("'%04d-%02d-%02d'", $matches2[3], $month_arr[$matches2[2]], $matches2[1]); } #echo "snap niet: $matches2[3] . $matches2[2]. $matches2[1] \n" ; return $date; }