WordPress功能函数calendar_week_mod()

WordPress功能函数calendar_week_mod()

1675
2021-04-06 10:22:46

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 ) );

}

更新日志:
WordPress功能函数calendar_week_mod() (https://www.wpzt.net/) WordPress开发教程 第1张
用户贡献的笔记

(由Nil**bar Shar**于5年前贡献)

从一周的开始计算天数

echo calendar_week_mod( 10 );

输出:

3

喜欢这个文章就点个赞分享给好友吧~

END

发表回复

一次支付终身使用
免费版本更新
靠谱的技术支持