 | | Offres d'emplois |  | Intégrateur web Société spécialisée dans la Vente par Internet recrute :
Intégrateur Web en CDI
Débutants Passionnés.
Connaissances requises :
- maîtrise d... | |
 | | Avez vous lu ? |  | | |
|
 Créer des dossiers | |  |

<?
function make_dir($dir) {
$ch ='';
$tb_info = pathinfo($dir);
if(strlen($tb_info['dirname']) >
strlen($tb_info['basename'])) {
$tb_dir = explode("/", $tb_info['dirname']);
}
else {
$tb_dir = $tb_info['basename'];
}
if(is_array($tb_dir) && count($tb_dir) > 0) {
$txt='';
for($i=0;$i<count($tb_dir);$i++) {
$dir = $ch . $tb_dir[$i];
if(!is_dir($dir)) {
if(mkdir($dir, 755)) {
$txt .= 'creation : ' . $dir . '<br>';
$ch .= $tb_dir[$i].'/';
}
}
else {
$txt .= 'Dossier existant : ' . $dir . '<br>';
$ch .= $tb_dir[$i].'/';
}
}
$ch .= $tb_info['basename'];
if(!is_dir($ch)) {
if (mkdir($ch, 755)) {
$txt .= 'creation : ' . $ch;
}
}
else {
$txt .= 'Dossier existant : ' . $ch . '<br>';
}
}
else {
if (mkdir($dir, 755)) {
$txt = $tb_info['basename'];
}
}
return $txt;
}
echo make_dir('images/miniatures/produits');
?>
|
|
|
 |
|