Is it possible to retrieve file modification information from a remote server using PHP?

Yes, it is possible to retrieve file modification information from a remote server using PHP by using FTP or SSH protocols to connect to the server and retrieve the file modification time. This can be achieved by using PHP functions like ftp_connect, ftp_login, ftp_mdtm for FTP connections or ssh2_connect, ssh2_auth_password, ssh2_sftp_stat for SSH connections.

// Example using FTP connection
$ftp_server = 'example.com';
$ftp_user = 'username';
$ftp_pass = 'password';
$ftp_file = '/path/to/file.txt';

$ftp_conn = ftp_connect($ftp_server);
ftp_login($ftp_conn, $ftp_user, $ftp_pass);

$mod_time = ftp_mdtm($ftp_conn, $ftp_file);
echo "Last modified time of file: " . date("Y-m-d H:i:s", $mod_time);

ftp_close($ftp_conn);