title: delete directory in codeigniter
body: <p>iam doing my project in codeigniter in that i used to create new directory to upload my images.now i need to delete my new directory for that i have tired this coding, </p>
  
  <pre><code> $dir = '/var/www/uploads/chat/'.$input['chat_id'];
     system('/bin/rm -rf ' . escapeshellarg($dir));
  </code></pre>
  
  <p>but its not working for me.i have got this coding from this link <code>http://stackoverflow.com/questions/1296681/php-simplest-way-to-delete-a-folder-including-its-contents</code> what i need to do?</p>