I am trying to remove folders and its files and sub folders using php.
This is how I tried it.
$dir     = "../../images/$category_id/$delId"; 
$it      = new RecursiveDirectoryIterator($dir, RecursiveDirectoryIterator::SKIP_DOTS);
$files = new RecursiveIteratorIterator($it, RecursiveIteratorIterator::CHILD_FIRST);
foreach($files as $file) {
    if ($file->isDir()){
        rmdir($file->getRealPath());
    } else {
        unlink($file->getRealPath());
    }
}
rmdir($dir);
This is working on php 5.5+, but is doesn't work in php 5.2.17.
Can anybody tell me how I get it to work on 5.2 also. Thank you.
 
     
    
Fatal error: Undefined class constant 'SKIP_DOTS' in /home2/public_html/admin /includes/process_edit.php on line 124
` – user3733831 Feb 08 '16 at 14:19