fork download
  1. <?php
  2.  
  3. $arr = array();
  4. $current = new SplFileInfo('C:\dir\file.php');
  5. for($i = 0;$i < 10;$i++){
  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] => /
    [1] => /
    [2] => /
    [3] => /
    [4] => /
    [5] => /
    [6] => /
    [7] => /
    [8] => /
    [9] => C:\dir\file.php
)