Ok I am reasonable sure I can find a workaround, but I was just wondering if this is already part of the PHP function set...
Given a URL:
http://www.domain.com/users/test.php?query=111
The function "parse_url" returns the host, the path and the query, like so:
(1) domain.com
(2) /users/test.php
(3) query=111
So, path ends up being "/users/test.php". What I'd like to do is split up the path, so it ends up being:
PATH: /users/
FILE: test.php
Essentially, I have to strip the called filename from the PATH, and put it in the variable FILE.
What I have thought of so far, is just to explode("/", $path);
and then rebuild the path by stepping through the array one-by-one and rebuilding it, leaving off the last element in the array. The last element will be pushed to variable FILE instead, giving me a split.
However, it would be simpler if I could "LIMIT EXPLODE" to one slash, but parse the string BACKWARDS.
Any ideas?
Take care,
... Christopher