I created this function http://www.key5.com/demo/getpath/getpath.php3
Take a look. Be careful that sometimes you must use (-4) to get the -second level of path. ----- Original Message ----- From: "Christian Sandfeld" <[EMAIL PROTECTED]> To: <[EMAIL PROTECTED]> Sent: Tuesday, October 09, 2001 3:41 PM Subject: [PHP-WIN] Stripping filepath from string > Hi list, > > I know I have seen this somewhere - but I can't find it (and for some reason > I can't get my head around it). > > Is there a predefined function or alternatively an easy way to strip the > filepath of a string containing both filepath and filename? > > Strings could look like this: > /my/file/path/myfile > /my/file/path/myfile.name > c:\my\file\path\myfile > c:\my\file\path\myfile.name > etc... > > I know this should be fairly simple, but my mind is blank (if there's no > predefined function I know I should probably use some regex, but me and > regex don't get along (I always mess up)). > > Any help will be greatly appreciated :-) > > /Christian > > -- > PHP Windows Mailing List (http://www.php.net/) > To unsubscribe, e-mail: [EMAIL PROTECTED] > For additional commands, e-mail: [EMAIL PROTECTED] > To contact the list administrators, e-mail: [EMAIL PROTECTED] > > -- PHP Windows Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]