getting part of a string

From: Date: Wed, 09 Jul 2003 04:18:17 +0000
Subject: getting part of a string
Groups: php.general 
Request: Send a blank email to php-general+get-154483@lists.php.net to get a copy of this message
Anyone have a sure way of grabbing just the file name from a string that looks like this: C:/Documents and Settings/Bobo the Bugbear/My Documents/My Pictures/1.gif I would like to pull off, just the name "1.gif" or even better just "1" without the extension. I've been working on: $filevalue = str_replace("\\\\", "/", $filevalue); $parts = explode("/",$filevalue); $file_name = $parts[count($parts)]; but with no luck. thanks

« previous php.general (#154483) next »