<form method="POST" action="admin.php" enctype="multipart/form-data">
<span>фото:</span>
<input type="file" name="photosimg[]" multiple required>
<button name="newpagebutton">Создать страницу</button>
</form>
foreach($_FILES as $file){
move_uploaded_file($file["photosimg"]["tmp_name"] "../img/pages/photos/".$file["photosimg"]["name"]);
$data = $_POST;
$nouser->photosimg = "img/pages/photos/".$file["photosimg"]["name"];
R::store($nouser);
}
foreach($_FILES as $file){
move_uploaded_file($_FILES["photosimg"]["tmp_name"][$file], "../img/pages/photos/".$_FILES["photosimg"]["name"]);
$data = $_POST;
$nouser->photosimg = "img/pages/photos/".$_FILES["photosimg"]["name"];
R::store($nouser);
}