you are here

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
nelsok
Forum Newbie
Posts: 1
Joined: Thu Jun 26, 2008 3:12 pm

you are here

Post by nelsok »

I want to be able to break a part the output from $_SERVER['REQUEST_URI'] so that

http://domain.tld/database/category/food/index.php

will return

$top_level = database
$second_level = category
$third_level = food

any ideas?

Thanks.
User avatar
Weirdan
Moderator
Posts: 5978
Joined: Mon Nov 03, 2003 6:13 pm
Location: Odessa, Ukraine

Re: you are here

Post by Weirdan »

Code: Select all

 
list(,,,$top_level, $second_level, $third_level) = explode('/', $_SERVER['REQUEST_URI']);
 
Post Reply