Is it possible to expand the $ _FILES array by adding custom parameters? Those. For example, by default, it looks like mine

array(1) { ["file"]=> array(5) { ["name"]=> array(1) { [0]=> string(9) "image.jpg" } ["type"]=> array(1) { [0]=> string(10) "image/jpeg" } ["tmp_name"]=> array(1) { [0]=> string(39) "D:\OpenServer\userdata\temp\phpBBE7.tmp" } ["error"]=> array(1) { [0]=> int(0) } ["size"]=> array(1) { [0]=> int(1092727) } } } 

Can I somehow add my parameters (elements) here?

    1 answer 1

    Can. The $_FILES superglobal array works on writing and reading as a regular array.

    But the question is: why would you need this? It is better to create a wrapper in the form of a class, in the constructor of which you pass $_FILES and $_FILES class as you need.

    • Understood thanks. Well, for example, so that you can transmit information about the image (in my case), for example, cropping parameters, description, etc. - Guest