Code: Select all
function filename() {
// format: client_type_date.ext
$client = $_POST['client'];
$client = strtolower(str_replace(' ', '', $client));
$type = $_POST['type'];
$type = strtolower(str_replace(' ', '', $type));
$date = date('d_m_Y');
$mimetype = $_FILES['userfile']['type'];
$ext = substr(strrchr($mimetype, "."), 1);
return "$client_$type_$date.$ext";
}Any help is much appreciated.