Ouwe rakker |
|
<?php
if (file_exists('images/' . $_FILES['bestand']['name'])) {
$i = 2;
$sFilename = substr($_FILES['bestand']['name'], 0 , strrpos($_FILES['bestand']['name'], '.'));
$sExtension = strrchr($_FILES['bestand']['name'], '.');
while (file_exists('images/' . $sFilename . $i . $sExtension)) {
$i++;
}
$sNewFilename = $sFileName . $i . $sExtension;
}
<?php if (file_exists('images/' . $_FILES['bestand']['name'])) { $i = 2; $sFilename = substr($_FILES['bestand']['name'], 0 , strrpos($_FILES['bestand']['name'], '.')); $sExtension = strrchr($_FILES['bestand']['name'], '.'); while (file_exists('images/' . $sFilename . $i . $sExtension)) { $i++; } $sNewFilename = $sFileName . $i . $sExtension; }
Kijk maar of je hier iets mee kan. Niet getest natuurlijk dus als er fouten in zitten mag je ze zelf oplossen ;) |