public static function getDirectorySize($dir) {
		if (is_dir($dir)) {
			$totalSize = 0;
			$iterator = new RecursiveIteratorIterator(new RecursiveDirectoryIterator($dir));
			foreach($iterator as $file) {
				$totalSize += $file->getSize();
			}
			return $totalSize;
		}
		return false;
	}
public static function getDirectorySize($dir) {
		if (is_dir($dir)) {
			$totalSize = 0;
			$iterator = new RecursiveIteratorIterator(new RecursiveDirectoryIterator($dir));
			foreach($iterator as $file) {
				$totalSize += $file->getSize();
			}
			return $totalSize;
		}
		return false;
	}
public static function getDirectorySize ( $ dir ) { if ( is_dir ( $ dir ) ) { $ totalSize = 0 ; $ iterator = new RecursiveIteratorIterator ( new RecursiveDirectoryIterator ( $ dir ) ) ; foreach ( $ iterator as $ file ) { $ totalSize += $ file -> getSize ( ) ; } return $ totalSize ; } return false ; }
Get total size of files in directory and subdirectories

@param string $dir
@return integer
Get total size of files in directory and subdirectories