$file = $_FILES;
if(isset($file["download"]["error"]) ){
foreach($file["download"]["error"] as $key => $error){
if($error == 0){
$safely = basename($file["download"]["name"][$key]);
move_uploaded_file($file["download"]["tmp_name"][$key], "Download/".$safely);
echo "Загружено<br>";
}}
}
foreach($file["download"]["error"] as $key => $error){
if($error ==0){
move_uploaded_file($file["download"]["tmp_name"][$key], "Download/".$file["download"]["name"][$key]);
echo ++$a."Успешно <br>";
}}
Fatal error: Uncaught Error: Call to undefined function mb_substr() in D:\Opa.kg\index.html:64 Stack trace: #0 {main} thrown in
$file = $_FILES;
$names = ["file1", "file2", "file3"];
foreach($names as $items) {
if(!empty($file[$items]["name"]) ){
if($file[$items]["error"] ==0){
move_uploaded_file($file[$items]["tmp_name"], "Download/". $file[$items]["name"]);
echo "Имя файла:". mb_substr($file[$items]["name"], 0, 128). // Ошибка =(
"<br>Кол-во символов в имени файла: ".strlen($file[$items]["name"]);
}
}}