Posted by Janwillem Borleffs on 09/28/13 11:41
Steve wrote:
> I need to find what that text greater than one charactor appears
> after the last / in a string and ignor any file extention that may
> appear at the end of the string.
>
> example $string = "/foldername/anotherfoldername/file.txt";
>
> I was told to use preg_match() but havent a clue on what i am doing?
>
Sounds like you want the file name. For this, simply use basename():
$filename = basename($string);
JW
Navigation:
[Reply to this message]
|