“PHP Get This Week Date Range” Respostas de código

Como obter a data de início da semana no PHP

$firstday = date('l - d/m/Y', strtotime("this week"));
echo "First day of this week: ", $firstday;
Thoughtful Tapir

PHP Get Day of Week

date('w'); //gets day of week as number(0=sunday,1=monday...,6=sat)

//note:returns 0 through 6 but as string so to check if monday do this:
if(date('w') == 1){
	echo "its monday baby";
}
Grepper

PHP Get This Week Date Range

$monday = strtotime('last monday', strtotime('tomorrow'));
$sunday = strtotime('+6 days', $monday);
echo "<P>". date('d-M-Y', $monday) . " to " . date('d-M-Y', $sunday) . "</P>";
Grumpy Goshawk

Respostas semelhantes a “PHP Get This Week Date Range”

Perguntas semelhantes a “PHP Get This Week Date Range”

Mais respostas relacionadas para “PHP Get This Week Date Range” em PHP

Procure respostas de código populares por idioma

Procurar outros idiomas de código