2
Test gmstrftime() function : usage variation - Passing day related format strings to format argument.
5
/* Prototype : string gmstrftime(string format [, int timestamp])
6
* Description: Format a GMT/UCT time/date according to locale settings
7
* Source code: ext/date/php_date.c
11
echo "*** Testing gmstrftime() : usage variation ***\n";
13
// Initialise function arguments not being substituted (if any)
14
$timestamp = gmmktime(8, 8, 8, 8, 8, 2008);
15
setlocale(LC_ALL, "en_US");
16
date_default_timezone_set("Asia/Calcutta");
18
//array of values to iterate over
20
'Day of the month as a decimal number' => "%d",
21
'Day of the year as a decimal number' => "%j",
22
'Day of the week as a decimal number' => "%w"
25
// loop through each element of the array for timestamp
27
foreach($inputs as $key =>$value) {
29
var_dump( gmstrftime($value) );
30
var_dump( gmstrftime($value, $timestamp) );
36
*** Testing gmstrftime() : usage variation ***
38
--Day of the month as a decimal number--
42
--Day of the year as a decimal number--
46
--Day of the week as a decimal number--