If an item no longer exists in an array but there is a folder with the no longer required name. What would be the best way to check and remove the folder?
Example:
I have an array('blah','apple','oneDirection');
I will then run a command to create a folder/dir in a specific location with the names in the array but if oneDirection
is no longer in the array I would like to delete the folder/dir -> Would I use in_array
?
The array data comes from an external JSON feed so it will be removed automatically and when this is done I would like it to delete the folder/dir - I am not sure on the array and folder/dir name checking structure