Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我有一个项目,在该项目中,用户获得了与其订阅相关的每月特定小时数,如果他在月底还有一些小时数,他的剩余小时数将在下个月的小时数中添加。例如,如果用户订阅了 1400 小时的订阅,并且他在月底还有 20 小时的剩余时间,那么在下个月他将获得 1420 小时。但是,在我的数据库中,小时数以 1400:00:00 的形式存储,所以我得到值 20:00:00 我如何添加 1400:00:00。
$string = '1400:00:00'; $explode = explode(':',$string); $hours = $explode[0]; $new_hours = $hours + 20;