Autor Zpráva
otam85
Profil
zdravim, mam takuto situaciu: vytvaram pomocou php subor "nieco.xls" a teraz chcem vediet ako overit ze ten subor nieco.xls uz existuje a ked existuje tak vytvorit novy s nazvom "nieco-1.xls" a ked aj ten existuje tak "nieco-2.xls". Overit by som ta aj vedel cez File_Exists(), ale ako to zvysovat stale o 1,2,3 atd...Dakujem
Alphard
Profil
cyklus ?
třeba for(;;) nebo while()
tiso
Profil
radšej while:
$end="";

$ext=".xls";
$i=0;
while (!file_exist($filename.$end.$ext){
$i++;
$end='-'.$i;
}
//teraz vytvor subor $filename.$end.$ext
otam85
Profil
aha dakujem...fakt banalita... :)
Toto téma je uzamčeno. Odpověď nelze zaslat.

0