dirname() and basename()
dirname()
basename()
Not that I'm aware, no. What I'd do is:
realpath()
/
Use dirname() and basename().