<?php
$_FILES = [
'file1' => [
'name' => 'MyFile.txt',
'type' => 'text/plain',
'tmp_name' => '/tmp/php/php1h4j1o',
'error' => UPLOAD_ERR_OK,
'size' => 123,
],
'file2' => [
'name' => 'MyFile.txt',
'type' => 'text/plain',
'tmp_name' => '/tmp/php/php137z5o',
'error' => UPLOAD_ERR_OK,
'size' => 123,
]
];
$files = $_FILES;
// The above two are for demo purposes only, mocking the REST API.
// Use the below code for WordPress.
//$files = $request->get_file_params();
$cleanFiles = array_column($files, 'tmp_name');
var_dump($cleanFiles);
preferences:
23.64 ms | 405 KiB | 5 Q