fork download
  1. <?php
  2.  
  3. $arr = array();
  4. $current = new SplFileInfo('C/dir/file.php');
  5. while($current->getFilename() !== "/"){
  6. array_push($arr,$current->getFilename());
  7. $current = $current->getPathInfo();
  8. }
  9.  
  10.  
  11. ?>
Success #stdin #stdout 0s 13112KB
stdin
Standard input is empty
stdout
Array
(
    [0] => C
    [1] => dir
    [2] => file.php
)