1--TEST-- 2Test strftime() function : usage variation - Passing day related format strings to format argument. 3--FILE-- 4<?php 5echo "*** Testing strftime() : usage variation ***\n"; 6 7// Initialise function arguments not being substituted (if any) 8setlocale(LC_ALL, "en_US"); 9date_default_timezone_set("Asia/Calcutta"); 10$timestamp = mktime(18, 8, 8, 8, 8, 2008); 11 12 13//array of values to iterate over 14$inputs = array( 15 'Day of the month as a decimal number' => "%d", 16 'Day of the year as a decimal number' => "%j", 17 'Day of the week as a decimal number' => "%w" 18); 19 20// loop through each element of the array for timestamp 21 22foreach($inputs as $key =>$value) { 23 echo "\n--$key--\n"; 24 var_dump( strftime($value) ); 25 var_dump( strftime($value, $timestamp) ); 26}; 27 28?> 29--EXPECTF-- 30*** Testing strftime() : usage variation *** 31 32--Day of the month as a decimal number-- 33string(%d) "%d" 34string(2) "08" 35 36--Day of the year as a decimal number-- 37string(%d) "%d" 38string(3) "221" 39 40--Day of the week as a decimal number-- 41string(%d) "%d" 42string(1) "5" 43