所有時間我有約會陣列這樣希望當前月在PHP
$dateArray = array('2012-04-11','2012-04-29','2012-04-26','2012-04-23','2012-03-21','2012-07-23','2012-12-19','2012-04-27','2012-05-12','2012-05-27','2012-05-28');
和IM使用代碼來過濾這個數組是
,但它不工作
$start_date= date('Y-m-d',strtotime('first day of this month')) ;
$end_date =date('Y-m-d',strtotime('first day of next month')) ;
$month = array();
foreach ($dateArray as $dates)
{
$dateTimes = strtotime($dates);
if (($start_date >= $dateTimes) && ($end_date <= $dateTimes))
{
$month[]= $dates;
}
}
var_dump($month);
但它的不起作用
與magento有什麼關係? – Alexandre 2012-04-27 11:28:50