PHP ftp_mdtm() İşlevi
Örnek
FTP sunucusundaki bir dosyanın son değiştirilme zamanını alın:
<?php
// connect and login to FTP server
$ftp_server = "ftp.example.com";
$ftp_conn = ftp_connect($ftp_server) or die("Could not connect to $ftp_server");
$login = ftp_login($ftp_conn, $ftp_username, $ftp_userpass);
$file = "somefile.txt";
// get the last modified time
$lastchanged = ftp_mdtm($ftp_conn, $file);
if ($lastchanged != -1)
{
echo "$file was last modified on : " . date("F d Y H:i:s.",$lastchanged);
}
else
{
echo "Could not get last modified";
}
// close connection
ftp_close($ftp_conn);
?>
Tanım ve Kullanım
ftp_mdtm() işlevi, belirtilen dosyanın en son değiştirildiği zamanı döndürür.
Not: Tüm sunucular bu işlevi desteklemez ve bu işlev dizinlerle çalışmaz.
Sözdizimi
ftp_mdtm(ftp_conn, file);
Parametre Değerleri
Parameter | Description |
---|---|
ftp_conn | Required. Specifies the FTP connection to login to |
file | Required. Specifies the file to check |
Teknik detaylar
Geri dönüş değeri: | Başarı durumunda Unix zaman damgası olarak son değiştirilen zaman, başarısızlık durumunda -1 |
---|---|
PHP Sürümü: | 4+ |
❮ PHP FTP Referansı