315 posts
  • Bought between 100 and 499 items
  • Has been a member for 7-8 years
  • United States
timmylogue says

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

338 posts
  • Most Wanted Bounty Winner
  • Sold between 10 000 and 50 000 dollars
  • Exclusive Author
  • Has been a member for 3-4 years
  • Referred between 10 and 49 users
  • Author had a Free File of the Month
  • Microlancer Beta Tester
  • Bought between 10 and 49 items
amzee says

This is quite easy ;)

Steps:

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)
{     
    @unlink($dir);
}

hope this helps!

by
by
by
by
by
by