<?php
function mkdir_recursif($dir) {
    $parties = preg_split('#/|' . preg_quote(DIRECTORY_SEPARATOR) . '#', $dir, -1, PREG_SPLIT_NO_EMPTY);
    $base = '';
    foreach ($parties as $p) {
        if (!eregi(".*\.([a-z]{2,4}|inc-dist|js-src|js-dist|php-src|php-dist|xml-dist|xml-src|inc-src)$",$p)) @mkdir($base . $p);
        $base .= $p . DIRECTORY_SEPARATOR;
    }
}
?>