protected function getFileInfo(string $file, $returned_values = ['name', 'server_path', 'size', 'date'])
	{
		if (! is_file($file))
		{
			return false;
		}

		if (is_string($returned_values))
		{
			$returned_values = explode(',', $returned_values);
		}

		foreach ($returned_values as $key)
		{
			switch ($key)
			{
				case 'name':
					$fileInfo['name'] = basename($file);
					break;
				case 'server_path':
					$fileInfo['server_path'] = $file;
					break;
				case 'size':
					$fileInfo['size'] = filesize($file);
					break;
				case 'date':
					$fileInfo['date'] = filemtime($file);
					break;
				case 'readable':
					$fileInfo['readable'] = is_readable($file);
					break;
				case 'writable':
					$fileInfo['writable'] = is_writable($file);
					break;
				case 'executable':
					$fileInfo['executable'] = is_executable($file);
					break;
				case 'fileperms':
					$fileInfo['fileperms'] = fileperms($file);
					break;
			}
		}

		return $fileInfo;
	}
protected function getFileInfo(string $file, $returned_values = ['name', 'server_path', 'size', 'date'])
	{
		if (! is_file($file))
		{
			return false;
		}

		if (is_string($returned_values))
		{
			$returned_values = explode(',', $returned_values);
		}

		foreach ($returned_values as $key)
		{
			switch ($key)
			{
				case 'name':
					$fileInfo['name'] = basename($file);
					break;
				case 'server_path':
					$fileInfo['server_path'] = $file;
					break;
				case 'size':
					$fileInfo['size'] = filesize($file);
					break;
				case 'date':
					$fileInfo['date'] = filemtime($file);
					break;
				case 'readable':
					$fileInfo['readable'] = is_readable($file);
					break;
				case 'writable':
					$fileInfo['writable'] = is_writable($file);
					break;
				case 'executable':
					$fileInfo['executable'] = is_executable($file);
					break;
				case 'fileperms':
					$fileInfo['fileperms'] = fileperms($file);
					break;
			}
		}

		return $fileInfo;
	}
protected function getFileInfo ( string $ file , $ returned_values = [ 'name' , 'server_path' , 'size' , 'date' ] ) { if ( ! is_file ( $ file ) ) { return false ; } if ( is_string ( $ returned_values ) ) { $ returned_values = explode ( ',' , $ returned_values ) ; } foreach ( $ returned_values as $ key ) { switch ( $ key ) { case 'name' : $ fileInfo [ 'name' ] = basename ( $ file ) ; break ; case 'server_path' : $ fileInfo [ 'server_path' ] = $ file ; break ; case 'size' : $ fileInfo [ 'size' ] = filesize ( $ file ) ; break ; case 'date' : $ fileInfo [ 'date' ] = filemtime ( $ file ) ; break ; case 'readable' : $ fileInfo [ 'readable' ] = is_readable ( $ file ) ; break ; case 'writable' : $ fileInfo [ 'writable' ] = is_writable ( $ file ) ; break ; case 'executable' : $ fileInfo [ 'executable' ] = is_executable ( $ file ) ; break ; case 'fileperms' : $ fileInfo [ 'fileperms' ] = fileperms ( $ file ) ; break ; } } return $ fileInfo ; }
Get File Info

Given a file and path, returns the name, path, size, date modified
Second parameter allows you to explicitly declare what information you want returned
Options are: name, server_path, size, date, readable, writable, executable, fileperms
Returns FALSE if the file cannot be found.

@param string $file            Path to file
@param mixed  $returned_values Array or comma separated string of information returned

@return array|false
Get File Info