Question: I was wondering how I could create a new directory for each user that registered to my site so that they would be able to upload their material to their own directory. I've looked all over the place but haven't really found anything that I could use, because I need it to be dynamic, and I've only found how to name the directory by specifying the name in mkdir.

Thanks in advance.

Answer: 
Say `$user` contains username of the user this will do the work.

```
$user = "youruser";

if (!file_exists("path/to/".$user)) {
    mkdir("path/to/".$user, 0755, true);
}

```

be careful about permissions and input sanitization.
Use `mkdir` function : `mkdir("some/path/{$username}", 0755);`