PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!
Moderator: General Moderators
ozzy
Forum Commoner
Posts: 74 Joined: Tue Apr 11, 2006 4:45 pm
Post
by ozzy » Sun Apr 16, 2006 10:41 am
feyd wrote: the usage of
basename() explains why. The file doesn't exist in the local directory, so
filemtime() can't find the file.
Thanks, using your info i added:
and directed the time using that:
Code: Select all
. date ("F d Y H:i:s.", filemtime($location))
------
Onto my next problem...
All the dates and times which are being displayed are:
feyd
Neighborhood Spidermoddy
Posts: 31559 Joined: Mon Mar 29, 2004 3:24 pm
Location: Bothell, Washington, USA
Post
by feyd » Sun Apr 16, 2006 10:43 am
You're requesting the modification time of a directory, not a file inside that directory.
ozzy
Forum Commoner
Posts: 74 Joined: Tue Apr 11, 2006 4:45 pm
Post
by ozzy » Sun Apr 16, 2006 11:01 am
How would i fix this?
It tyed changing
to
Code: Select all
$location = "vuns/files/$filename"; But that didnt work
feyd
Neighborhood Spidermoddy
Posts: 31559 Joined: Mon Mar 29, 2004 3:24 pm
Location: Bothell, Washington, USA
Post
by feyd » Sun Apr 16, 2006 11:19 am
Why even use
basename() if you're adding the directory back on?
You can use
basename() after the call to
filemtime() to do whatever you are using the file name for.
ozzy
Forum Commoner
Posts: 74 Joined: Tue Apr 11, 2006 4:45 pm
Post
by ozzy » Sun Apr 16, 2006 11:50 am
I know how to insert the basename, or insert the filename. But what i need to do is insert them both together to so that it can get the date and time, but how would i need to change the code below to do that?
Code: Select all
. date ("F d Y H:i:s.", filemtime($location));
ozzy
Forum Commoner
Posts: 74 Joined: Tue Apr 11, 2006 4:45 pm
Post
by ozzy » Sun Apr 16, 2006 11:54 am
Sorry about the double post, but i have managed to do it.
Code: Select all
. date ("F d Y H:i:s.", filemtime($location . $filename));