To create nested folder In windows OS use suppressor @.
This suppressor will handle user type errors also.
$path = 'testpath\nested1\nested2\nested3\';
@mkdir( $path, '0777', TRUE);
Besides you can create a function-
function createMyDir( $path ){
return @mkdir( $path, '0777', TRUE);
}