Domanda flash
C'è un modo umano per conoscere al volo il numero dell'ultimo giorno del mese?
Oppure bisogna partire con 31, passare giorno/mese/anno a checkdate, verificare, se non va bene passare 30 eccc eccc???
Argh
Grazie e ciao![]()
Domanda flash
C'è un modo umano per conoscere al volo il numero dell'ultimo giorno del mese?
Oppure bisogna partire con 31, passare giorno/mese/anno a checkdate, verificare, se non va bene passare 30 eccc eccc???
Argh
Grazie e ciao![]()
un attimo...modifico il post quando ho trovato
edit
Codice PHP:
$giornimese = date("t", time());
// Number of days in the given month
ma porka di quella *%$ç$$&$%$%$$![]()
![]()
lo sapevo che era facile...![]()
Grazie mille!![]()
passare time() come secondo parametro non serve, la funzione date() usa di default il tempo attuale se non viene specificato diversamente.
http://it.php.net/mktime
Example 2. Last day of next month
The last day of any given month can be expressed as the "0" day of the next month, not the -1 day. Both of the following examples will produce the string "The last day in Feb 2000 is: 29".
<?php
$lastday = mktime(0, 0, 0, 3, 0, 2000);
echo strftime("Last day in Feb 2000 is: %d", $lastday);
?>