Jump to content

SHowing the path.


rofl90

Recommended Posts

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

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.