In this code to upload an image, how does mkdir work? I see in the php documentation that mkdir creates a directory but in the case that I show the directory is already created . This example works perfectly, I just want to know how it works mkdir do you create the folder or just choose the specified folder?
$id_banner=intval($_POST['id']);
$target_dir = "../../img/banner/";
$carpeta=$target_dir;
if (!file_exists($carpeta)) {
mkdir($carpeta, 0777, true);
}