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

  • Christopher Bill

    Christopher

    30 NİSAN 2009
  • GOTO Conferences

    GOTO Confere

    3 EKİM 2011
  • Matthew Pearce

    Matthew Pear

    9 AĞUSTOS 2009