Answers for "how to check the day of any date in php"

PHP
6

php get day from date

$timestamp = strtotime('2009-10-22');

$day = date('D', $timestamp);
var_dump($day);
Posted by: Guest on June-10-2020
0

how to check the day of any date in php

// how to check the day of any date in php?

//Our YYYY-MM-DD date string.
$date = $request->start_date;

//Convert the date string into a unix timestamp.
$unixTimestamp = strtotime($date);

//Get the day of the week using PHP's date function.
$dayOfWeek = date("l", $unixTimestamp);

//Print out the day that our date fell on.
$day = $date . ' fell on a ' . $dayOfWeek;
Posted by: Guest on March-05-2021
0

php check if day in month

// function
cal_days_in_month(calendar,month,year);
//e.g.
$d=cal_days_in_month(CAL_GREGORIAN,10,2005);
echo "There was $d days in October 2005";
Posted by: Guest on August-05-2020

Code answers related to "how to check the day of any date in php"

Browse Popular Code Answers by Language