WordPress功能函数calendar_week_mod(),从一周的开始计算天数。
参数
$num
(int) (必需) 天的数量。
返回
(float)从本周开始的天数。
来源
文件: wp-includes/general-template.php
function calendar_week_mod( $num ) {
$base = 7;
return ( $num – $base * floor( $num / $base ) );
}
更新日志:

用户贡献的笔记

(由Nil**bar Shar**于5年前贡献)
从一周的开始计算天数
echo calendar_week_mod( 10 );
输出:
3
© 版权声明
文章版权归作者所有,未经允许请勿转载。
THE END
暂无评论内容