I have a php code as follows:
$titleA = $_POST["title"];
if (in_array($_FILES["file"]["type"], $valid_mime_types)) {
$destination = "bannerImages/" . $_FILES["file"]["name"];
move_uploaded_file($_FILES["file"]["tmp_name"], $destination); }
I would like to change the file name with $titleA variable. But the extension will be the same. basically, filename will become what has been written for title. let me say, original file is first.jpeg second will be second.jpeg.
Hello if i understand you correctly you are having problem extracting extension information. you can always use
pathinfoExample
Output