rofl90 Posted March 30, 2007 Share Posted March 30, 2007 How can you get PHP to show the path of the file eg Home > Attack > Kill > etc. And take out the '.php' Link to comment https://forums.phpfreaks.com/topic/44970-showing-the-path/ Share on other sites More sharing options...
micah1701 Posted March 30, 2007 Share Posted March 30, 2007 here's what I would do. ( i just wrote this off the top of my head, so it might now work perfectly. but you get the idea ) <?php $path = $_SERVER['PHP_SELF']; // returns /home/attack/kill/etc.php $valuesArray = explode("/",$path); /* returns: $valuesArray[0] = "" $valuesArray[1] = "home" $valuesArray[2] = "attack" $valuesArray[3] = "kill" $valuesArray[4] = "etc.php" */ foreach ($valuesArray as $value){ $name = explode(".",$value); echo $name[0]; if($name[1] == ""){ echo " > "; } } ?> Link to comment https://forums.phpfreaks.com/topic/44970-showing-the-path/#findComment-218330 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.