Jump to content

Recommended Posts

Hello. I want an xml document to update every five minutes. I want to check the documents last modified against the the value of time(). but i cant seem to get it formatted properly. What ( string $format , ) do i use to return an integer formatted like the integer returned by time()? Or i am i going about this all wrong?

 

date (" ???string $format??? ", getlastmod($folder.$filename))

 

Thanks in advance guys

A) getlastmod() does not accept a parameter in the function call. Perhaps you meant to use filemtime()?

 

B) Both getlastmod() and filemtime() return a Unix Timestamp.

 

Please make use of the php.net documentation for the function(s) you are trying to use.

Sorry i did look at the manual. This was the example given thats why i was going about it the way i was.

 

$filename = 'somefile.txt';
if (file_exists($filename)) {
    echo "$filename was last modified: " . date ("F d Y H:i:s.", filemtime($filename));
}

 

This worked perfectly thank you guys.

$date1 = date (filemtime($folder.$filename));

 

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.