fork download
  1. <?php
  2.  
  3. $path = "this/is/the/path/file.txt";
  4.  
  5. $parts = explode("/", $path);
  6.  
  7. echo "<pre>";
  8. print_r($parts);
  9. echo "</pre>";
Success #stdin #stdout 0.01s 23412KB
stdin
Standard input is empty
stdout
<pre>Array
(
    [0] => this
    [1] => is
    [2] => the
    [3] => path
    [4] => file.txt
)
</pre>