Since several days ago I am trying to upload several images through a form, I did a var_dump to the amount that it brought me and it was the correct one, but when uploading, the two did not go up but one (the first), here is the code, I remain attentive, thank you.
$cantidad = count($_FILES["imagen"]["tmp_name"]);
var_dump($cantidad);
for ($i = 0; $i < count($_FILES["imagen"]); $i++) {
$nombre_temporal = $_FILES["imagen"]["tmp_name"][$i];
var_dump($nombre_temporal);
$nombreImagen = basename($_FILES['imagen']['name'][$i]);
var_dump($nombreImagen);
exit;
$carpeta = ROOT . "public" . DIRECTORY_SEPARATOR . "galeria//";
// $nombre_subido = basename($_FILES['imagen']['name'][$i]);
$Subida = move_uploaded_file($nombre_temporal, $carpeta . $nombreImagen);
$mdo->__SET("nombre_imagen", $nombre_subido);
$imagen = $mdo->registrarImagen();
// var_dump($imagen);
// exit;
}