Jump to content

[SOLVED] Help with this please


tcorbeil

Recommended Posts

Someone gave me this script to use:

 

list(,$dir) = split("/", $_SERVER['SCRIPT_NAME']);

 

basically what it does is this:

 

If i have a path that is something like /oilers/oiler.php

 

the above script removes the oilers.php part so that all remains is /oilers

 

but...

 

I have a problem if the path exceeds more than 1 dash  .. ex /sports/hockey/oilers/oilers.php

 

what remains is /sports...

 

i need the whole link minus the running file.. eg, /sports/hockey/oilers    ...

 

Any idea as to how i could do this?

 

Thanks

T.

Link to comment
https://forums.phpfreaks.com/topic/43920-solved-help-with-this-please/
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.