Olası Çoğalt: Yıl numarasını PHP ile nasıl edinebilirim?
2009 bu yıl
How do I use PHP to get the current year?
Olası Çoğalt: Yıl numarasını PHP ile nasıl edinebilirim?
2009 bu yıl
How do I use PHP to get the current year?
Bak() ve strtotime():
echo date('Y');
echo date('Y', strtotime('+1 year'));
Bir tarih bir kısmını ayıklamak için tarih fonksiyonunu kullanabilirsiniz:
$year = date("Y"); // get the year part of the current date
$nextYear = $year + 1;
pasajını here çalıştırın.
Kullanım getdate() fonksiyon işlevleri tarihte
... ve strftime('%Y')
yapar çok
<?php
$date="2010-04-30";
$y = date('Y',strtotime($date));
echo $y;
?>
Olası yinelenen: http://stackoverflow.com/questions/64003/how-do-i-use-php-to-get-the-current-year –