I had to make a code that automatically creates a folder and in that folder had to come my photo that I was going to upload, That works now. But now I have to make a code that that you can see which photos are in the folder and that has to be done automatically. so have to echo the picture name but automatically
my code:
<?php
ini_set('display_errors', 1);
ini_set('display_startup_errors', 1);
error_reporting(E_ALL);
include 'helpers.php';
$foldername = uniqid();
$destination = "vierkant/$foldername";
//Check if the directory already exists.
if(!is_dir($destination)){
//Directory does not exist, so lets create it.
mkdir($destination, 0755, true);
}
$files = [];
for ($i = 0; $i < count($_FILES['file']['name']); $i++) {
move_uploaded_file(
$_FILES['file']['tmp_name'][$i],
$destination . '/' . $_FILES['file']['name'][$i]
);
//
print_r($_FILES['file']['name']);
}