Need little help, i get always stupid errors, when i try to do this, i want to foreach array, and inside that do a for loop, is this possible? Here is my code
$image = new SimpleImage();
$slike=array($_FILES['slika1']['tmp_name'],$_FILES['slika2']['tmp_name'],$_FILES['slika3']['tmp_name'],$_FILES['slika4']['tmp_name']);
$koliko = count($slike);
foreach ($slike as $slika) {
for ($i = 1; $i <= $koliko; $i++)
{
$slicica="../images/usluge/".mysql_insert_id()."-".$i.".jpg";
$image->load($slika);
$image->resizeToWidth(800);
$image->save($slicica);
}
}
I want to get new pictures with this name, example.If last id was 2 i want to get this filenames etc
- 2-1.jpg
- 2-2.jpg
- 2-3.jpg
- 2-4.jpg
Still with my code i dont get correct values :( Or maybe there is easy way to do that :)