PHP 文字列をタイムスタンプに変換 strtotime(2018/09/09)

2018/09/09(0) 87

PHP 文字列をタイムスタンプに変換 strtotime(2018/09/09)

目次

文字列をタイムスタンプに変換 strtotime(2018/09/09)

文字列をタイムスタンプに変換 strtotime(2018/09/09)

文字列の日付からタイムスタンプを取りたい時。

$timestamp = strtotime(2018/09/09);
print $timestamp;
>
1536444000


これでも大丈夫。

$timestamp = strtotime(2018-09-09);
print $timestamp;
>
1536444000