Code: Select all
<?php
$filename = "/path/to/file";
// Connect and login to ftp server
$Connection = ftp_connect(ftp_server_IP_ addres) or die("Could not connect!");
ftp_login($Connection,"user","pass");
// Get time file was last modified
$UNIXtime = ftp_mdtm($Connection, $filename);
// Convert to human readable time
if ($UNIXtime != -1) {
$FILEtime = date("Y:m:d", $UNIXtime);
}
else echo "Error!";
// Close ftp connection
ftp_close($Connection);
?>I do not expect to help me with my server problem, but if someone have idea, please share it with me . But, what I realy need to know: What is wrong with ftp_mdtime()?