1

Im trying to compare the creation date, and current date to do some operations depending on the outcome, the thing is, during my local development, everything was fine, all worked like a charm, but when i upload my script to the webhost, everything went down south, the following code

echo $date_modified = date ("F d Y H:i:s.", filemtime($file)); //date of modification of the file

Gives me the same result as

echo $current_time = date("F d Y H:i:s."); //the current time

¿ How is that even possible and why ?.

EDIT

More on the subject, as i tried and tried to debug the script, i finally found out that, apparently, the sever is actively modifying the text file the php script is creating and placing 'null' on the file, ¿for what reason? i'm really not sure, but it seems like this is a problem related to the hosting, so i guess i'll have to search for a new hosting, as i really needed the file to be created to be able to cache some information without overloading the web service that was providing the information to fill in the file.

4

3 に答える 3

1

filemtime($file)ファイルが最後に変更された時刻 (「作成」ではなく、docs を参照) を返しています。これは、おそらくスクリプトが Web ホストにアップロードされた時刻です。

于 2013-07-26T05:23:46.990 に答える
1

$fileそれが実際にファイルであり、開こうとしたときに適切なパスを使用していることを確認してください。

于 2013-07-26T05:07:35.480 に答える