For recurrent following function work better.
Some ftp servers (like WarFTP) become demented if you'll
try mkdir not from root dir and if path will be relative.
The second if one of dir (like '/') already exist You'll get access denied.
function MkDir($path)
{
$dir=split("/", $path);
$path="";
$ret = true;
for ($i=1;$i<count($dir);$i++)
{
$path.="/".$dir[$i];
echo "$path\n";
if(!@ftp_chdir($this->conn_id,$path)){
@ftp_chdir($this->conn_id,"/");
if(!@ftp_mkdir($this->conn_id,$path)){
$ret=false;
break;
}
}
}
return $ret;
}