How to delete images from a folder using PHP Script
<p>We need to delete  images created in linux file system. in a path <code>/home/user/img/</code> (All images)</p>

<p>We have tried using <code>unlink()</code> but it is taking lot of time to delete it.
Can someone help us how to delete images using linux commands must be passed with php script. I think <code>rm</code> command can do quickly but i am confused how to use</p>

<p>Our script:</p>

<pre><code>$locationIMG_p="/home/user/img/";
$location_p="/home/user/img/";

$opend=opendir($locationIMG_p);

while(false!==($rf=readdir($opend)))
{           
    unlink($locationIMG_p.$rf);
}         

closedir($opend);
</code></pre>
