protected static function remove_matching_dir($src,$dst) {
		if (!$dst || !$src || !is_dir($src) || !is_dir($dst)) return;	// prevent deleting an entire disk by accidentally calling this with an empty string!
		$dir = opendir($src);

		while(false !== ( $file = readdir($dir)) ) {
			if (( $file != '.' ) && ( $file != '..' )) {
				if ( is_dir($src . '/' . $file) ) {
					self::remove_dir($dst . '/' . $file);
				}
				else {
					if (file_exists($dst . '/' . $file)) {
						unlink($dst . '/' . $file);
					}
				}
			}
		}
		closedir($dir);
	}
protected static function remove_matching_dir($src,$dst) {
		if (!$dst || !$src || !is_dir($src) || !is_dir($dst)) return;	// prevent deleting an entire disk by accidentally calling this with an empty string!
		$dir = opendir($src);

		while(false !== ( $file = readdir($dir)) ) {
			if (( $file != '.' ) && ( $file != '..' )) {
				if ( is_dir($src . '/' . $file) ) {
					self::remove_dir($dst . '/' . $file);
				}
				else {
					if (file_exists($dst . '/' . $file)) {
						unlink($dst . '/' . $file);
					}
				}
			}
		}
		closedir($dir);
	}
protected static function remove_matching_dir ( $ src , $ dst ) { if ( ! $ dst || ! $ src || ! is_dir ( $ src ) || ! is_dir ( $ dst ) ) return ; // prevent deleting an entire disk by accidentally calling this with an empty string! $ dir = opendir ( $ src ) ; while ( false !== ( $ file = readdir ( $ dir ) ) ) { if ( ( $ file != '.' ) && ( $ file != '..' ) ) { if ( is_dir ( $ src . '/' . $ file ) ) { self :: remove_dir ( $ dst . '/' . $ file ) ; } else { if ( file_exists ( $ dst . '/' . $ file ) ) { unlink ( $ dst . '/' . $ file ) ; } } } } closedir ( $ dir ) ; }
Remove the files in the destination directory whose names match the files in the source directory.

@param string $src	Source directory
@param string $dst	Destination directory
Remove the files in the destination directory whose names match the files in the source directory .