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;