FUDforum
Fast Uncompromising Discussions. FUDforum will get your users talking.

Home » Imported messages » comp.lang.php » Showing last part of a directory
Show: Today's Messages :: Polls :: Message Navigator
Switch to threaded view of this topic Create a new topic Submit Reply
Showing last part of a directory [message #175430] Thu, 22 September 2011 18:32 Go to next message
houghi is currently offline  houghi
Messages: 45
Registered: September 2011
Karma: 0
Member
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.

houghi
--
Let's not be too tough on our own ignorance. It's the thing that makes
America great. If America weren't incomparably ignorant, how could we
have tolerated the last eight years? -- Frank Zappa, in 1988
Re: Showing last part of a directory [message #175431 is a reply to message #175430] Thu, 22 September 2011 19:10 Go to previous messageGo to next message
The Natural Philosoph is currently offline  The Natural Philosoph
Messages: 993
Registered: September 2010
Karma: 0
Senior Member
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.
>
> houghi

http://uk.php.net/pathinfo
Re: Showing last part of a directory [message #175432 is a reply to message #175431] Thu, 22 September 2011 19:32 Go to previous messageGo to next message
houghi is currently offline  houghi
Messages: 45
Registered: September 2011
Karma: 0
Member
The Natural Philosopher wrote:
> 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.
>>
>> houghi
>
> http://uk.php.net/pathinfo

Thanks.

houghi
--
> This is written under the influence of tv channel
> Vijf TV (as there was nothing else on).

> I am now watching : Bride Wars
Re: Showing last part of a directory [message #175454 is a reply to message #175430] Wed, 28 September 2011 18:31 Go to previous message
tamouse is currently offline  tamouse
Messages: 5
Registered: September 2011
Karma: 0
Junior Member
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
  Switch to threaded view of this topic Create a new topic Submit Reply
Previous Topic: Config problem?
Next Topic: best editor
Goto Forum:
  

-=] Back to Top [=-
[ Syndicate this forum (XML) ] [ RSS ]

Current Time: Mon Nov 25 21:17:36 GMT 2024

Total time taken to generate the page: 0.02190 seconds