Tuesday, 15 January 2013

How to Remove Remote FTP Folders older than 3 days in PHP -



How to Remove Remote FTP Folders older than 3 days in PHP -

i need remove folders in ftp storage older 3 days. mean creation date, not modification date. should php ftp commands. here code don't work properly:

$skip = array('.', '..', '.ftpquota', '.htaccess'); $expire_date = date('y-m-d', strtotime('-3 days', time())); $ff_list = ftp_nlist($con, $db_dir); foreach($ff_list $item) { if(in_array($item, $skip)) { continue; } $mod_time = ftp_mdtm($con, $item); if(strtotime($expire_date ) >= $mod_time) { ftp_rmdir($con, $item); } }

please allow me know how create okay...

php ftp

No comments:

Post a Comment