328 posts
  • Has been part of the Envato Community for over 8 years
  • Has collected 100+ items on Envato Market
  • Located in United States

I been searching and trying to get this to work. I’ve gotten really close but I don’t want to screw this up because I have about 250 directories and I have to make sure I delete what I need deleted :D

OK, So I have about 250 directories and inside those directories there is a folder called “myImages”

Can any help me out and give me a example on how to delete “myImages” from all 250 directories? Just “myImages” tho.

I thought I would ask the pro’s instead of me screwing up something ;)

Thanks! Timothy

399 posts
  • Sells items exclusively on Envato Market
  • Won a Most Wanted contest
  • Made it to the Authors' Hall of Fame
  • Has sold $10,000+ on Envato Market
+5 more

This is quite easy ;)


1. Recursively read all the dirs 2. Get the absolute path of all the ‘myimages’ into a data structure say ‘Array’ 3. Run the process on new built array
foreach($dirs as $k=>$dir)

hope this helps!

Helpful Information

  • Please read our community guidelines. Self promotion and discussion of piracy is not allowed.
  • Open a support ticket if you would like specific help with your account, deposits or purchases.
  • Item Support by authors is optional and may vary. Please see the Support tab on each item page.

Most of all, enjoy your time here. Thank you for being a valued Envato community member.

Post Reply

Format your entry with some basic HTML. Read the Full Details, or here is a refresher:

<strong></strong> to make things bold
<em></em> to emphasize
<ul><li> or <ol><li> to make lists
<h3> or <h4> to make headings
<pre></pre> for code blocks
<code></code> for a few words of code
<a></a> for links
<img> to paste in an image (it'll need to be hosted somewhere else though)
<blockquote></blockquote> to quote somebody

:grin: :shocked: :cry: Complete List of Smiley Codes