Remove extension from a filename

Description PHP

Removes the extension (and dot) of a filename

The Code Download

  1. <?php
  2. function RemoveExtension($filename) {
  3.     $file = substr($filename, 0,strrpos($filename,'.'));   
  4.     return $file;
  5. }
  6. ?>


Added by JC on 11th November 2007


There are no comments about this snippet.

Post Comment Github Markdown Supported

You must be logged in to post a comment.

Login here to post a comment