Snippets v2

Languages
My Snippets

Get Filename from full file path Login or Register to Bookmark this snippet

Description PHP

Gets a filename from a full path with it's parent directory, the right part of string before the '/'

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

Added by JC on 11th 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