delete folder with all content with php
<p>I have main folder named "gallery". In this folder there are some sub folders like "animal", "tree", etc. folder "animal" contains some pictures and so on. suppose i want to delete "animal" folder with all pictures in it, how can do this? 
i tried-</p>

<pre><code>rmdirr($_SERVER['DOCUMENT_ROOT']."admin/gallery/animal");
</code></pre>

<p>but in server, it deleted the whole "gallery" folder with all in it. please tell me what i am doing wrong and also give me a solution. thanks in advance.</p>
