1--TEST-- 2Test idate() function : usage variation - Passing supported Date format characters to format argument. 3--FILE-- 4<?php 5/* Prototype : int idate(string format [, int timestamp]) 6 * Description: Format a local time/date as integer 7 * Source code: ext/date/php_date.c 8 * Alias to functions: 9 */ 10 11echo "*** Testing idate() : usage variation ***\n"; 12 13// Initialise function arguments not being substituted (if any) 14date_default_timezone_set("Asia/Calcutta"); 15 16//array of values to iterate over 17$inputs = array( 18 19 'Day of the month' => 'd', 20 'Leap Year' =>'L', 21 'Month number' => 'm', 22 'Days in the month' => 't', 23 'Day of the week' => 'w', 24 'ISO-8601 week number' => 'W', 25 'Year (1 or 2 digits)' => 'y', 26 'Year 4 digits' => 'Y', 27 'Day of the year' => 'z', 28); 29 30// loop through each element of the array for timestamp 31foreach($inputs as $key =>$value) { 32 echo "\n--$key--\n"; 33 var_dump( idate($value) ); 34}; 35?> 36===DONE=== 37--EXPECTF-- 38*** Testing idate() : usage variation *** 39 40--Day of the month-- 41int(%d) 42 43--Leap Year-- 44int(%d) 45 46--Month number-- 47int(%d) 48 49--Days in the month-- 50int(%d) 51 52--Day of the week-- 53int(%d) 54 55--ISO-8601 week number-- 56int(%d) 57 58--Year (1 or 2 digits)-- 59int(%d) 60 61--Year 4 digits-- 62int(%d) 63 64--Day of the year-- 65int(%d) 66===DONE=== 67