This code can be used to remove an extension from the file name using php.
function RemoveExtension($strName)
{
$ext = strrchr($strName, ‘.’);if($ext !== false)
{
$strName = substr($strName, 0, -strlen($ext));
}
return $strName;
}$Name = ‘file.txt’;
echo RemoveExtension($filename);
However, in my case, i tried using it with a bunch of code but wasn’t successful, it did removed the extension of the file name but it caused the remaining code to stop executing. I didn’t work out on why it caused it as was busy in some more important part of that code.