function removeExtension(string $filename): string { $i = strrpos($filename, '.'); # Get the LAST dot if ($i === false) return $file; return substr($filename, 0, $i); }
Programming Tips - PHP: remove a file's extension
Date: 2018sep13
Language: php
Keywords: suffix
Q. PHP: remove a file's extension