Save file with date, random number and name

0

I have the following PHP code in an upload system, which saves the uploaded file with random number and date. In the HTML there are the fields "Branch" and "Name", I would like to know how to make these two infos be saved together with the date and number. At the moment it is saved so 682 + 16-01-2018 + certificate.pdf, I would like you to save branch + name + 682 + 16-01-2018 + certificate.pdf.

class MultiploUpload {

public $diretorio        = "docs/";
public $numeroAleatorio;
public $data;



function MultiploUpload($nomeArquivo , $tamanho , $tmp_nome , $tipo){       

    $contador   =  count($nomeArquivo);
    $this->numeroAleatorio = rand(0,1000);
            $this->data = date('d-m-Y');
    for($i = 0 ; $i <= $contador ; $i++){
        move_uploaded_file($tmp_nome[$i] , $this->diretorio.$this->numeroAleatorio.'+'.$this->data.'+'.$nomeArquivo[$i]);
    }
}
    
asked by anonymous 16.01.2018 / 19:06

0 answers