Showing last part of a directory [message #175430] |
Thu, 22 September 2011 18:32 |
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 |
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 |
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 |
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
|
|
|