Tutorials Point


  Learning PHP
  Advanced PHP
  PHP Function Reference
  PHP Useful Resources
  Selected Reading

Copyright © 2014 by tutorialspoint



  Home     References     Discussion Forums     About TP  

PHP Function jddayofweek ()


previous

Advertisements

Syntax

jddayofweek ( $julianday [, $mode] );

Definition and Usage

This function returns the day of the week. Can return a string or an integer depending on the mode.

Paramters

ParameterDescription
juliandayRequired. A julian day number as integer
modeOptional. 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)

Return Value

The gregorian weekday as either an integer or string.

Example

Try out following example:

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

This will produce following result:

Thursday

previous Printer Friendly

Advertisements


  

Advertisements