What is the best way to do the following:
I get a path with an AJAX request
e.g. dir1/dir2/dir3/dir4
I need to present it like this on my we
Var 1
/dir1/dir2/dir3/dir4/
[1] => /dir1/dir2/dir3/
[2] => /dir1/dir2/
[3] => /dir1/
)
*/
?>
Var 2 ( Links )
'.basename($str).'');
while((array_pop($arr) and !empty($arr))){
$out[] = ''.end($arr).'';
};
print_r($out);
/*
Array
(
[0] => dir4
[1] => dir3
[2] => dir2
[3] => dir1
)
*/
?>