framework/web/UploadedFile.php
public static function getInstancesByName($name)
    {
        $files = self::loadFiles();
        if (isset($files[$name])) {
            return [new static($files[$name])];
        }
        $results = [];
        foreach ($files as $key => $file) {
            if (strpos($key, "{$name}[") === 0) {
                $results[] = new static($file);
            }
        }

        return $results;
    }
public static function getInstancesByName($name)
    {
        $files = self::loadFiles();
        if (isset($files[$name])) {
            return [new static($files[$name])];
        }
        $results = [];
        foreach ($files as $key => $file) {
            if (strpos($key, "{$name}[") === 0) {
                $results[] = new static($file);
            }
        }

        return $results;
    }
public static function getInstancesByName ( $ name ) { $ files = self :: loadFiles ( ) ; if ( isset ( $ files [ $ name ] ) ) { return [ new static ( $ files [ $ name ] ) ] ; } $ results = [ ] ; foreach ( $ files as $ key => $ file ) { if ( strpos ( $ key , "{$name}[" ) === 0 ) { $ results [ ] = new static ( $ file ) ; } } return $ results ; }
Returns an array of uploaded files corresponding to the specified file input name.
This is mainly used when multiple files were uploaded and saved as 'files[0]', 'files[1]',
'files[n]'..., and you can retrieve them all by passing 'files' as the name.
@param string $name the name of the array of files
@return UploadedFile[] the array of UploadedFile objects. Empty array is returned
if no adequate upload was found. Please note that this array will contain
all files from all sub-arrays regardless how deeply nested they are.
Returns an array of uploaded files corresponding to the specified file input name . This is mainly used when multiple files were uploaded and saved as files [ 0 ] files [ 1 ] files [ n ] ... and you can retrieve them all by passing files as the name .