Here's the correct code for making recursive directories:
<?php
function ftp_mksubdirs($ftpcon,$ftpbasedir,$ftpath){
@ftp_chdir($ftpcon, $ftpbasedir); $parts = explode('/',$ftpath); foreach($parts as $part){
if(!@ftp_chdir($ftpcon, $part)){
ftp_mkdir($ftpcon, $part);
ftp_chdir($ftpcon, $part);
}
}
}
$path_of_storage = '/var/www/uploads';
$newftpdir = '2013/06/11/username';
$conn_id = ftp_connect($ftpserver);
ftp_login($conn_id, $login, $pass);
ftp_mksubdirs($conn_id,$path_of_storage,$newftpdir);
ftp_close($conn_id);
?>