This PHP  function gives you ability to remove a directory and its all content recursively.

<?php
function rrmdir($dir){if(is_dir($dir)){ 
     $objects = scandir($dir);foreach($objects as $object){if($object !="."&& $object !=".."){if(filetype($dir."/".$object)=="dir") rrmdir($dir."/".$object);else unlink($dir."/".$object);}} 
     reset($objects); 
     rmdir($dir);}}
rrmdir('directory_path'); // Give your directory path here
?>