Creating directory in uploads: mkdir vs wp_mkdir_p

There is not much a difference but, for wp_mkdir_p() we can only pass the full path to attempt to create a folder. It is recursive directory creation function which check for the file_exists() or not. And moreover we don’t need to pass the folder permission because it checks for the parent directory permission and sets the folder permission as that of the parent directory.

But, with mkdir() we need to check for the file_exists() function before creating a directory and the directory permission will be set as the permission defined by the WordPress itself during the setup.