Sanzi
Numero di biglietti: 2
Orario di partenza: 15 giugno, 2007
Orario di ritorno: 22 giugno, 2007
Prezzo IVA incluso: EUR 1.350,99
Displaying the Web Page??™s Most Recent Modification Date
Barely a decade old, the Web is already starting to look like a packrat??™s office. Documents
are strewn everywhere, many of which are old, outdated, and often downright
irrelevant. One of the commonplace strategies for helping the visitor determine the
document??™s validity involves adding a timestamp to the page. Of course, doing so manually
will only invite errors, as the page administrator will eventually forget to update
the timestamp. However, it??™s possible to automate this process using date() and
getlastmod(). The getlastmod() function returns the value of the page??™s Last Modified
header, or FALSE in the case of an error. Its prototype follows:
int getlastmod()
CHAPTER 1 2 ?– D ATE AND T IME 339
If you use it in conjunction with date(), providing information regarding the page??™s
last modification time and date is trivial:
$lastmod = date("F d, Y h:i:sa", getlastmod());
echo "Page last modified on $lastmod";
This returns output similar to the following:
Page last modified on February 26, 2007 07:59:34pm
Determining the Number of Days in the Current Month
To determine the number of days in the current month, use the date() function??™s
t parameter. Consider the following code:
printf("There are %d days in %s.
Pages:
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416