|
Posted by Bent Stigsen on 05/29/06 14:22
frizzle wrote:
[snip]
> $_SERVER['QUERY_STRING'] = '/artists/nirvana/mtv_unplugged'
> $array[0] => artists
> $array[1] => nirvana
> $array[2] => mtv_unplugged
> $array[3] => NULL
[snip]
This one above is your real problem. You would need some mechanism to
determine what kind last element is, file or part of path. A lazy way
could be to set the criteria or just make the assumption that files
always has an attached extension (i.e. '.' in the name).
For instance:
function DefineLoc(){
$loc = explode('/', trim( $_SERVER['QUERY_STRING'], '/' ) );
if (strrpos(end($loc), '.')===false) $loc[] = null;
reset($loc);
return $loc;
};
If you have pathnames containing '.', then you would have to write
some code that can make the distinction.
/Bent
Navigation:
[Reply to this message]
|