Powiel możliwe:
How do I use PHP to get the current year?Jak zdobyć numer roku z PHP?
2009 to rok, 2010 w przyszłym roku.
Powiel możliwe:
How do I use PHP to get the current year?Jak zdobyć numer roku z PHP?
2009 to rok, 2010 w przyszłym roku.
Spójrz na bieżąco funkcji() i strtotime():
echo date('Y');
echo date('Y', strtotime('+1 year'));
Można użyć funkcji daty, aby wyodrębnić część randkę:
$year = date("Y"); // get the year part of the current date
$nextYear = $year + 1;
Uruchom fragment here.
Zastosowanie getdate() funkcja
... i strftime('%Y')
robi to zbyt
<?php
$date="2010-04-30";
$y = date('Y',strtotime($date));
echo $y;
?>
Możliwy duplikat: http://stackoverflow.com/questions/64003/how-do-i-use-php-to-get-the-current-year –