Is there any way to put 2 arrays in the same foreach?
Let me explain what I need, I'm using the WideImage class to resize the images, I need to grab the image extension to save it later. My problem is, how can I get the length of each array image?
I can even do with a foreach type like this:
foreach ($image as $imagem) {
foreach ($imagemExtensao as $extensao) {
$extensaoDaImagem = pathinfo($extensao, PATHINFO_EXTENSION);
$imagemFinal = $imagem->resize(400, 300);
$geraNome = md5(time().rand());
$imagemFinal->saveToFile('imagens/usuarios/' . $geraNome .'.'.$extensaoDaImagem);
$nomeCompleto = $geraNome.'.'.$extensaoDaImagem;
}
}
But it duplicates the images, the names, everything. So I have to do it once, or if you have another idea.