Sure, I'm using the following two lines to create the directories and an index page in them:
mkdir("$user");
touch("$user/index.php");
These are followed by some simple file writing lines that build the index.php page based on user input from a form, but that's about it.