Symfony\Component\Filesystem\Filesystemを用いる。
use Symfony\Component\Filesystem\Filesystem;
use Symfony\Component\Filesystem\Exception\IOException;
$fs = new Filesystem();
try {
    $fs->mkdir('/tmp/random/dir/' . mt_rand());
} catch (IOException $e) {
    echo "An error occurred while creating your directory";
}
これは便利。
メソッド一覧など詳細は下記URLを参照。
http://symfony.com/doc/2.3/components/filesystem.html