我在根据每月条款生成每周和每月日期安排时遇到问题。
November 2015-11-01
November 2015-11-08
November 2015-11-15
November 2015-11-22
December 2015-12-01
December 2015-12-08
December 2015-12-15
December 2015-12-22
January 2016-01-01
January 2016-01-08
January 2016-01-15
January 2016-01-22
February 2016-02-01
February 2016-02-08
February 2016-02-15
February 2016-02-22
我的问题是我无法排除小于当前日期的日期。
现在的日期是2015-11-17。
这是输出:
/*** quote the text for regex ***/
$n = preg_quote($n);
/*** highlight the words ***/
$comments['Updated'] = preg_replace("/\b($n)\b/i", '<b>\1</b>', $comments['Updated']);
答案 0 :(得分:1)
你从第1天开始循环。
从当前日期开始。
\w+