Browse - Programming Tips - Php remove a file's extension

Date: 2018sep13
Language: php
Keywords: suffix

Q.  Php remove a file's extension

function removeExtension($file) { $i = strrpos($file, '.'); # Get the LAST dot if ($i === false) return $file; return substr($file, 0, $i); }