Skip to content

Instantly share code, notes, and snippets.

@facumartig
Created July 13, 2013 20:49
Show Gist options
  • Save facumartig/5992167 to your computer and use it in GitHub Desktop.
Save facumartig/5992167 to your computer and use it in GitHub Desktop.
<?php
$dia = array("Domingo", "Lunes", "Mártes", "Miercoles", "Jueves", "Viernes", "Sábado");
$mes = array("", "Enero", "Febrero", "Marzo", "Abril", "Mayo", "Junio", "Julio", "Agosto", "Septiembre", "Octubre", "Noviembre", "Diciembre");
$actual_m = date("n");
$actual_d = date("j");
$actual_y = date("Y");
if ($timestamp = strtotime($_GET['d'])){
$days = date('N', $timestamp);
$days_number = date('t', $timestamp);
$month = $mes[date('n', $timestamp)];
$year = date('Y', $timestamp);
}
function PrimerDiaMes($mes,$año) {
$date = strtotime($año."-".$mes."-01");
$array_date = getdate($date);
$year = $array_date["year"];
$month = $array_date["mon"];
$month_day = $array_date["mday"];
$array_date = getdate(mktime(0, 0, 0, $month, 1, $year));
return $primerDia = $array_date["weekday"];
}
?>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment