Getting specific string from a longer string ?

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
scheinarts
Forum Commoner
Posts: 52
Joined: Wed Jul 25, 2007 2:37 am

Getting specific string from a longer string ?

Post by scheinarts »

Hi guys,

You are all familiar with the long path generated by windows when browsing/uploading a file.

Well, how do you get only the filename fro that whole long string, what ever length may be.

For example...

User browses their computer and selects path which look something like this:
C:\Documents and Settings\something\Desktop\JPG_images\image_folder\coolimage.jpg

How do I isolate coolimage by itself, so that I can use this as the title for the uploaded file?

Any help appreciated. Thanks.
User avatar
Oren
DevNet Resident
Posts: 1640
Joined: Fri Apr 07, 2006 5:13 am
Location: Israel

Post by Oren »

scheinarts
Forum Commoner
Posts: 52
Joined: Wed Jul 25, 2007 2:37 am

Post by scheinarts »

:) tnx
Post Reply