I would like to add the last modified date to the index page , the below code shows the 31/12/1969 is the last modified date.
echo date("d/m/Y",filemtime("index.php"));
I would like to add the last modified date to the index page , the below code shows the 31/12/1969 is the last modified date.
echo date("d/m/Y",filemtime("index.php"));
パスが間違っていると思います。最後に、開発システムでエラー設定を増やす必要があります。
エラーfilemtime()
が返された場合、 -callによってfalse
何がキャストされるか。0
date()
(疑似) 絶対パスを使用して、ファイルシステム上のファイルを参照する必要があります。
__DIR__ . '/path/to/index.php';
私の推測でfilemtime
は、ファイルが見つかりません。filemtime
0、または FALSE のように 0 に相当する何かを返しdate
、時間通りに適用する0
とエポック (1970 年 1 月 1 日) から 0 秒が返されます。
それがあなたが得ているもののように見えます。また、PHP <= 5.1 を使用していると思います。