After some research I found out that the following works:
unlink(\"mydir\")
and you have to use the recursive option in case you w
recursive
Simply
unlink("mydir") # will delete directory called 'mydir'