Today I'm going to show you about how to explode a path, eg example.com/dir/extra/link/etc.php becomes Dir Extra Link Etc. Essentially making it easy to build on to become Dir --> Extra --> Link --> Etc. Etc
Heres the code:
Enjoy!PHP Code:<?php
$path = $_SERVER['PHP_SELF']; // returns /home/attack/kill/etc.php
$valuesArray = explode("/",$path); // exploding the path
/* returns:
$valuesArray[0] = ""
$valuesArray[1] = "home"
$valuesArray[2] = "attack"
$valuesArray[3] = "kill"
$valuesArray[4] = "etc.php" // arrays
*/
foreach ($valuesArray as $value){
$name = explode(".",$value); // exploding again
echo $name[0]; // echoing the path part w/o
if($name[1] == ""){
echo " > "; // checking the path.
}
}
?>






lol.
Reply With Quote









but some people do use it, and it can be used sometimes.
