Wildcard in file_exists()
Posted: Tue Nov 04, 2003 4:19 pm
Hi all,
I just had a quick question on how I could solve this problem...
I'm creating a module for someone that will upload movies to their server. Before the upload, the script checks to see if any other similarly named movies are on the server and adds a number after the filename in order to not overwrite it (e.g. movie_1.mov, movie_2.mov, movie_3.mov, etc).
When checking it with file_exists(), I'd like to check for files with ANY extension with that name (e.g. check for movie_1.mp4, movie_1.asf, movie_1.*).
file_exists($mov_location . "/" . $mov_prefix . "_" . $move_next . ".mov");
I basically need the ".mov" above to be a wildcard.
Any help would be greatly appreciated!
I just had a quick question on how I could solve this problem...
I'm creating a module for someone that will upload movies to their server. Before the upload, the script checks to see if any other similarly named movies are on the server and adds a number after the filename in order to not overwrite it (e.g. movie_1.mov, movie_2.mov, movie_3.mov, etc).
When checking it with file_exists(), I'd like to check for files with ANY extension with that name (e.g. check for movie_1.mp4, movie_1.asf, movie_1.*).
file_exists($mov_location . "/" . $mov_prefix . "_" . $move_next . ".mov");
I basically need the ".mov" above to be a wildcard.
Any help would be greatly appreciated!