views:

47

answers:

1

How do you add an value with an => $key into an array, for example:

$images = array();

array_push($images, $_FILES['file']['tmp_name'] => $_FILES['file']['name']);

So the array would be like:

array('temporary_file_name' => 'file_name.zip');

But my IDE says it's invalid and would not work.

+6  A: 

I think this is what you want:

$images[$_FILES['file']['tmp_name']] = $_FILES['file']['name'];
alecRN