Try going to http://www.sitepoint.com/article//485
Your technique is wrong - you need to do this:
$var_array = explode("/",$PATH_INFO);
Instead of that - use:
$var_array = explode("/",$pi);
That will replace any two or more slashes(//-/*n) with a single /.
Thats a good fix - and wont hog the CPU.