Is valid page

17 Ⅴ 2010

See if a string is actually a date (used for friendly urls mostly)

// See if a string from the url is an actual date
function isDate($var){
        $time = strtotime(str_replace('-', ' ', $var));
        if($time){
                if(strlen($var) == 8){
                        return Array('month', $var, $time);
                }elseif(strlen($var) == 11){
                        return Array('day', $var, $time);
                }
        }
        return false;
}