Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.php > #3225

Re: Showing last part of a directory

From tamouse <tamouse.lists@gmail.com>
Newsgroups comp.lang.php
Subject Re: Showing last part of a directory
Date 2011-09-28 11:31 -0700
Organization http://groups.google.com
Message-ID <22726469.224.1317234689423.JavaMail.geo-discussion-forums@vbat14> (permalink)
References <slrnj7mvq2.pni.houghi@penne.houghi>

Show all headers | View raw


On Thursday, September 22, 2011 1:32:34 PM UTC-5, houghi wrote:
> I have a parameter with the content of e.g.
> $film="/media/video/download/tv/Lost Girl" All I want is the 'Lost Girl'
> part so it becomes $film="Lost Girl"
> 
> I am a bit at a loss as to what to use. Most likely trivial to do, I am
> sure, but my knowledge of php is too limited that I am not even sure
> what to enter as a search.

Simply $film=basename($film);

http://php.net/manual/en/function.basename.php

Back to comp.lang.php | Previous | Next — Previous in thread | Find similar | Unroll thread


Thread

Showing last part of a directory houghi <houghi@houghi.org.invalid> - 2011-09-22 20:32 +0200
  Re: Showing last part of a directory The Natural Philosopher <tnp@invalid.invalid> - 2011-09-22 20:10 +0100
    Re: Showing last part of a directory houghi <houghi@houghi.org.invalid> - 2011-09-22 21:32 +0200
  Re: Showing last part of a directory tamouse <tamouse.lists@gmail.com> - 2011-09-28 11:31 -0700

csiph-web