note 119544 deleted from function.is-dir by cmb

From: Date: Sun, 03 Jul 2016 22:04:27 +0000
Subject: note 119544 deleted from function.is-dir by cmb
References: 1  Groups: php.notes 
Request: Send a blank email to php-notes+get-205874@lists.php.net to get a copy of this message
Note Submitter: YAPs ---- Why check the path, if can create it <?PHP if(!defined('DS'))define("DS",DIRECTORY_SEPARATOR); if(!defined('FIR_CHMOD'))define("FIR_CHMOD",0755); function isDir($a) { $a=trim($a,DS); $k=str_replace(DS.DS,DS,$a.DS); if(is_dir($k))return $k; if(file_exists($k))return $k; $b=explode(DS,$a); $e=""; foreach($b as $c) if(!empty($c)&&!strstr($c,".")) { $c=trim($c,DS); $e.=str_replace(DS.DS,DS,$c.DS); if(!is_dir($e)) { mkdir($e,FIR_CHMOD); } } return $e; } ?>

« previous php.notes (#205874) next »