Snippets v2

Languages
My Snippets

Get Extension of a Filename Login or Register to Bookmark this snippet

Description PHP

Gets the right part of a string before the '.' in lowercase.

The Code Download
  1. <?php
  2. function GetExt($file) {
  3.     $tempext = strtolower(substr($file, strrpos($file,'.')+1,strlen($file)-strrpos($file,'.')));
  4.     return $tempext;
  5. }
  6. ?>
Credits Contact JC

Added by JC on 12th November, 2007

Comments

There are no comments about this snippet.

Post Comment HTML is allowed

You must be registered and logged in to post a comment.

Login here to post a comment