if(isset($_FILES['dosya']) && isset($_FILES['dosya']['name']) && !empty($_FILES['dosya']['name'])){
$icerikid = $_POST['icerikid'];
$_json = [];
foreach($_FILES['dosya']['name'] as $_key => $dosya_adi){
$gecici_yol = $_FILES['dosya']['tmp_name'][$_key];
if(move_uploaded_file($gecici_yol, "../../images/indexurunler/" . $dosya_adi)) {
$_json[] = ['ss_dosya_adi' => $dosya_adi];
echo $dosya_adi.' aktarildi'.PHP_EOL;
}else{
echo $dosya_adi.' aktarilamadi'.PHP_EOL;
}
}
if(!empty($_json)){
file_put_contents($icerikid.'.json', json_encode($_json));
}
}