W3Schools.com

PHP JDDayOfWeek() Function


PHP Calendar Reference Complete PHP Calendar Reference

Definition and Usage

The JDDayOfWeek() function returns the day of a week.

Syntax

jddayofweek(jd,mode)

Parameter Description
jd Required. A number (a Julian day count)
mode Optional. Defines what to return (integer or string). Mode values:
  • 0 - Default. Returns the day number as an int (0=Sunday, 1=Monday, etc)
  • 1 - Returns a string that contains the day of week (English-Gregorian)
  • 2 - Returns a string that contains the abbreviated day of week (English-Gregorian)


Example

<?php
$jd=cal_to_jd(CAL_GREGORIAN,date("m"),date("d"),date("Y"));
echo(jddayofweek($jd,1));
?>

The output of the code above could be:

Thursday


PHP Calendar Reference Complete PHP Calendar Reference
WEB HOSTING
Best Web Hosting
PHP MySQL Hosting
Best Hosting Coupons
UK Reseller Hosting
Cloud Hosting
Top Web Hosting
$7.95/mo SEO Hosting
Premium Website Design
WEB BUILDING
Download XML Editor
FREE Website BUILDER
Free Website Templates Free CSS Templates
Make Your Own Website
W3SCHOOLS EXAMS
Get Certified in:
HTML, CSS, JavaScript, XML, PHP, and ASP
W3SCHOOLS BOOKS
New Books:
HTML, CSS
JavaScript, and Ajax
STATISTICS
Browser Statistics
Browser OS
Browser Display
SHARE THIS PAGE