找出一个月中给定日期的周数
Posted
tags:
篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了找出一个月中给定日期的周数相关的知识,希望对你有一定的参考价值。
This simple function allows you to find a weeks position in the month based on a given date. For instance I needed to alert the user their date was the "Second Week Of January" during a given month. I may never use it again but it came in very handy for this particular project.
<?php function week_number( $date = 'today' ) { } ?> Usage Example: <?php $week_num = week_number(); echo "Today is the $week_num week of $month"; ?>
以上是关于找出一个月中给定日期的周数的主要内容,如果未能解决你的问题,请参考以下文章