PHP file_exists and wildcard

Posted by paracaudex on Stack Overflow See other posts from Stack Overflow or by paracaudex
Published on 2010-04-30T17:15:00Z Indexed on 2010/04/30 17:17 UTC
Read the original article Hit count: 312

Filed under:
|

Is there a way to write the PHP file_exists function so that it searches a directory for a file with an arbitrary extension. For instance, suppose I knew that a file were called "hello", but I didn't know the extension, how would I write a function that searched for a file called hello.* and returned the name of this file? As far as I can tell, file_exists will only search for a string.

Thanks.

© Stack Overflow or respective owner

Related posts about php

Related posts about wildcard