SORU
6 Kasım 2009, Cuma


Nasıl tarihi ayın son gününü bulmak için?

Nasıl PHP bu ayın son günü alabilir miyim?

Verilen:

$a_date = "2009-11-23"

2009-11-30; ve verilen istiyorum

$a_date = "2009-12-23"

2009-12-31 istiyorum.

CEVAP
6 Kasım 2009, Cuma


t belirli bir tarihe ay gün sayısı (the docs for date) döndürür:

$a_date = "2009-11-23";
echo date("Y-m-t", strtotime($a_date));

Bunu Paylaş:
  • Google+
  • E-Posta
Etiketler:

YORUMLAR

SPONSOR VİDEO

Rastgele Yazarlar

  • Joshua Bane

    Joshua Bane

    24 Temmuz 2007
  • Kontor.TV

    Kontor.TV

    14 Mart 2006
  • LearnKey

    LearnKey

    19 AĞUSTOS 2008