I am making a website the tech-tree of a game a friend is making. The tech-three itself is just a list of links going from one page to the other. The variables for each page are stored in a php file e.g.: mining.php. I don't want to have a massive list of files all in one folder. So far all I've managed to do is sort them into just the first branches of the tree with this:
$path = glob('tree/*/'.$page.'.php');
if ($path[0]) {
include $path[0];
Ideally I want to be able to access the file from anywhere in the tree.
e.g.: The file mining.php would be at tree/strength/mining.php. And the file pickaxe.php would be at tree/strength/mining/pickaxe.php. But I would be able to include either one with the same include. What could i use to get my known filename from any folder or subfolder in the tree folder.