create two thumbnails instead of one based on code
<p>i have this code which generates me a thumbnail, nw, what i need is for it to generate me two...
just to double the function, can you please show me how can i do it based on this one?</p>

<p>Thanks..</p>

<pre><code>function tamano_nuevo_foto($im_or, $ancho_nv, $dir_nv) {
    $img   = imagecreatefromjpeg($im_or);
    $datos = getimagesize($im_or);
    $ancho = $datos[0];
    $alto  = $datos[1];

    if ($ancho &gt; $ancho_nv) { //Si la imagen no lelga al máximo no la tocamos.
        $prop    = $alto / $ancho;
        $alto_nv = round($ancho_nv * $prop);
    } else {
        $ancho_nv = $ancho;
        $alto_nv  = $alto;
    }
    $im_nv    = imagecreatetruecolor($ancho_nv, $alto_nv);
    imagecopyresampled($im_nv, $img, 0, 0, 0, 0, $ancho_nv, $alto_nv, $ancho, $alto);
    imagejpeg($im_nv, $dir_nv);
    imagedestroy($im_nv);
}

if (!empty($_FILES)) {
    $tempFile   = $_FILES['Filedata']['tmp_name'];
    $targetPath = $_SERVER['DOCUMENT_ROOT'] . $_REQUEST['folder'] . '/';
    $targetPath = str_replace('//', '/', $targetPath);
    $targetFile = $targetPath . basename($_FILES['Filedata']['name'], '.' . $ext) . '_s.';
    tamano_nuevo_foto($tempFile, 120, $targetFile);
    echo str_replace($_SERVER['DOCUMENT_ROOT'], '', $targetFile);
}
</code></pre>
