Q:

parse_url() with colons and numbers

Since I don't have access to mod rewrite I am using this to parse my URL.
$path = explode("/", parse_url($_SERVER['REQUEST_URI'], PHP_URL_PATH));

So when my URL is /page/action/1 it works nicely. I get this:
[0] => [1] => page [2] => action [3] => 1

However when I have something like: /page/action/simple:1 it breaks. It returns nothing.
Does anyone know why this happens what I can do to fix it?

A:

So someone posted about urlencode() but then deleted their answer. I toyed around with it and found this solution. It isn't the greatest by any stretch but it worked for me.
I'd still be interested in hearing from anyone if they have any better alternatives. But here is what I changed.
$path = explode(urlencode("/"), parse_url(urlencode($_SERVER['REQUEST_URI']), PHP_URL_PATH));
foreach($path as &$item) $item = urldecode($item);

