Advertisement
Guest User

Untitled

a guest
Apr 24th, 2018
53
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 0.30 KB | None | 0 0
  1. function cp_createDir($path){
  2.     $path = explode('/', $path);
  3.     foreach ($path as $i => $piece){
  4.         if(empty($piece)) continue;
  5.         $folder = array_slice($path, 0, $i + 1);
  6.         $folder = implode('/', $folder);
  7.         if(!is_dir($folder)){
  8.             mkdir($folder);
  9.         }
  10.     }
  11. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement