[thelist] PHP string manipulation

Bj list at plainweb.co.uk
Thu Jun 26 18:28:44 CDT 2003


----- Original Message -----
From: "Mark Joslyn" <Mark.Joslyn at SolimarSystems.com>

> I need everything left of the last "/" returned as a string including the
> last "/" (essentially just removing the filename).

strrpos() gives you the position of the last occurrence of a character in a
string

So,
    $x = strrpos($fullpath, "/")
    $pathonly = substr($fullpath, 0, $x+1)




More information about the thelist mailing list