I need to put an URL (something along the lines of mysite.com/this/is/my/url) into an Array in a way that if the site itself is in a subfolder (something like mysite.com/a-folder/this/is/my/url) then it would not take "a-folder" into that array and if mod_rewrite is not enabled it wouldn't take index.php either. I know how to put the url into an array but I have no idea how to exclude items from it. Any help is appreciated.
My final goal would be to use an array instead of $_GET, but since the array changes when the site is in a subfolder, root, with or without mod_rewrite it wouldn't live up to my expectations. I need to be able to create an array that doesn't change the /this/is/my/url, so when I for example echo $arr['0'] it would return "this" instead of "a-folder" or "index.php".
There are any number of string functions you can use (stristr, strpos, etc...).
You could also try regex, but I think its generally agreed that is overkill.
But without understanding your question this is the best I can do.
Edit: Still a little confused, but maybe this?
foreach($array as $key=>$url) {
if(strpos($url, 'what you are looking for')) { unset($array[$key]); }
}