【PHP】指定した日付から現在までの経過日数を取得する関数

指定した日付から現在までの経過日数を取得する関数です。

if ( ! function_exists('elapsed_days'))
{
	function elapsed_days($date)
	{
		return ceil( ( time() - strtotime($date) ) / (24*60*60));
	}
}

 

コメントする

メールアドレスが公開されることはありません。 が付いている欄は必須項目です

This site uses Akismet to reduce spam. Learn how your comment data is processed.