free html hit counter
Create Folder Recursive PHP
Create Folder Recursive PHP
2019-06-25 / Dimas Lanjaka Kumala Indra
How to automatically create folder if not exists on spesific PATH
Bagaimana cara membuat folder secara rekursif bila tidak ada pada spesifik PATH
Create Folder Recursive PHP

<?php
//define document root first define document root dahulu
define('APP', $_SERVER['DOCUMENT_ROOT'], true);
// [func] path extraction and creation
function _folder_($d){
$d = str_replace(APP, '', rtrim($d, '/'));
$explode = explode('/', rtrim($d,'/'));
$explode = array_filter($explode);
$ready = (strtoupper(substr(PHP_OS, 0, 3)) === 'WIN' ? '' : '/');
foreach ($explode as $x) {
$ready = rtrim($ready,'/');
$ready .= '/'.$x;
$status = file_exists(APP.$ready);
if ($status === false){
mdir(APP.$ready);
}
}
return $d;
}
// [func] create folder permission 777
function mdir($x)
{
$oldmask = umask(0);
mkdir($x, 0777);
umask($oldmask);
}

//Usage Penggunaan
$folder_target =
?>

Create Folder Recursive PHP

PermaLink: https://www.webmanajemen.com/2019/06/create-folder-recursive-php.html
Incoming search terms for Create Folder Recursive PHP:
  • Create Folder Recursive PHP
  • Create Folder Recursive PHP WMI Gitlab

Google Rich Snippets | Schema Markup Validator | Google Pagespeed Insight