Page 1 of 1

question for string?

Posted: Mon Mar 30, 2009 2:20 pm
by mapperkids
Hi,

I have a string like this

"c:\Directory1\Directory2\Directory3\filename.zip"
"c:\Directory1\filename.zip"
"c:\Directory1\Directory2\Directory3\Directory4\filename.zip"


I want to extract only the "filename.zip" part to a variable. how can i do that.

Thanks,
Johnny

Re: question for string?

Posted: Mon Mar 30, 2009 2:22 pm
by pickle
You could try basename(), or explode(), or a combination of strrpos() and substr()

Re: question for string?

Posted: Mon Mar 30, 2009 2:23 pm
by mapperkids
pickle wrote:You could try basename(), or explode(), or a combination of strrpos() and substr()
Problem solved by using the Basename() function.
Thanks!