Is there a way to take a string and see if it appears in a filename or folder name in the files folder? It would need to check several folders.

Okay, that's the very best case. If there isn't an easy way to do that, is there a way to check multiple folders if we can build the correct filename from the string?

Comments

newbstah’s picture

found this: http://groups.drupal.org/node%252F13420

It's fun - doesn't give any definitive answers, but lists functions in the files api and asks people to guess what they do.

drawk’s picture

This isn't so much a Drupal question as a general PHP question. It sounds like what you want is a recursive version of file_exists - here's what Google turned up: http://www.phpro.org/examples/Recursive-File-Exists.html

newbstah’s picture

Thanks again, drawk! I'm going to assemble all your helpful advice tomorrow and try it out.