如何通过路径获取所有文件信息?

Is there a PHP function that returns all information about the file using the path as parameter? I need a information just like $_FILES array has: name,type,tmp_name(i alredy have this),error and size.

For example:

$file = get_file('path/to/file');
$_SERVER['SCRIPT_FILENAME'];

That should work.

Yes; take a look at finfo_file function.

According to the official documentation found @ http://php.net/manual/en/function.finfo-file.php

finfo_file -- finfo::file — Return information about a file

Procedural approach:

string finfo_file ( resource $finfo , string $file_name = NULL [, int $options = FILEINFO_NONE [, resource $context = NULL ]] )

Object Oriented approach:

public string finfo::file ( string $file_name = NULL [, int $options = FILEINFO_NONE [, resource $context = NULL ]] )