1// Create folder if not exist
2 $folderName = 'images/gallery';
3 $config['upload_path'] = $folderName;
4 if(!is_dir($folderName))
5 {
6 mkdir($folderName, 0777);
7 }
1// Create a directory with the permission level (optional)
2<?php
3mkdir("/path/to/my/dir", 0700);
4?>